Commit a62a175b authored by Stefano Rivera's avatar Stefano Rivera

New upstream version 1.4.2

parent 4ef9f9e7
``pkginfo`` Changelog
=====================
1.4.2 (2018-03-14)
------------------
- Use relative imports in pkginfo modules. Supports vendoring of the
package into setuptools.
- Add support for ``Provides-Extra`` and ``Description-Content-Type`` fields.
Per https://packaging.python.org/specifications/. See: PEP 566.
- Remove support for old setuptools leaving ``PKG-INFO`` in the root of
the project directory.
1.4.1 (2016-11-07)
------------------
- Packaging only change (invalid sdist built for 1.4.0).
1.4.0 (2016-11-04)
------------------
- Relicense under MIT license: the PSF license is not suitable for
third-party libraries.
1.3.2 (2016-05-24)
------------------
- Packaging-only change (automate fix for wheel built for 1.3.1).
1.3.1 (2016-05-24)
------------------
- Packaging-only change (invalid wheel built for 1.3.0).
1.3.0 (2016-05-23)
------------------
- Update homepage URL to point to Launchpad, rather than PyPI.
- Add support for building wheels.
- Add support for Python 3.5.
- Drop support for Python 2.6 and 3.2.
1.2.1 (2014-01-02)
------------------
......
MIT License
Copyright (c) 2009 Agendaless Consulting, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Metadata-Version: 1.1
Name: pkginfo
Version: 1.2.1
Version: 1.4.2
Summary: Query metadatdata from sdists / bdists / installed packages.
Home-page: http://pypi.python.org/pypi/pkginfo/
Home-page: https://code.launchpad.net/~tseaver/pkginfo/trunk
Author: Tres Seaver, Agendaless Consulting
Author-email: tseaver@agendaless.com
License: Python
License: MIT
Description-Content-Type: UNKNOWN
Description: ``pkginfo`` README
==================
......@@ -24,6 +25,50 @@ Description: ``pkginfo`` README
``pkginfo`` Changelog
=====================
1.4.2 (2018-03-14)
------------------
- Use relative imports in pkginfo modules. Supports vendoring of the
package into setuptools.
- Add support for ``Provides-Extra`` and ``Description-Content-Type`` fields.
Per https://packaging.python.org/specifications/. See: PEP 566.
- Remove support for old setuptools leaving ``PKG-INFO`` in the root of
the project directory.
1.4.1 (2016-11-07)
------------------
- Packaging only change (invalid sdist built for 1.4.0).
1.4.0 (2016-11-04)
------------------
- Relicense under MIT license: the PSF license is not suitable for
third-party libraries.
1.3.2 (2016-05-24)
------------------
- Packaging-only change (automate fix for wheel built for 1.3.1).
1.3.1 (2016-05-24)
------------------
- Packaging-only change (invalid wheel built for 1.3.0).
1.3.0 (2016-05-23)
------------------
- Update homepage URL to point to Launchpad, rather than PyPI.
- Add support for building wheels.
- Add support for Python 3.5.
- Drop support for Python 2.6 and 3.2.
1.2.1 (2014-01-02)
------------------
......@@ -221,13 +266,12 @@ Keywords: distribution sdist installed metadata
Platform: Unix
Platform: Windows
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
......
Metadata-Version: 1.1
Name: pkginfo
Version: 1.2.1
Version: 1.4.2
Summary: Query metadatdata from sdists / bdists / installed packages.
Home-page: http://pypi.python.org/pypi/pkginfo/
Home-page: https://code.launchpad.net/~tseaver/pkginfo/trunk
Author: Tres Seaver, Agendaless Consulting
Author-email: tseaver@agendaless.com
License: Python
License: MIT
Description-Content-Type: UNKNOWN
Description: ``pkginfo`` README
==================
......@@ -24,6 +25,50 @@ Description: ``pkginfo`` README
``pkginfo`` Changelog
=====================
1.4.2 (2018-03-14)
------------------
- Use relative imports in pkginfo modules. Supports vendoring of the
package into setuptools.
- Add support for ``Provides-Extra`` and ``Description-Content-Type`` fields.
Per https://packaging.python.org/specifications/. See: PEP 566.
- Remove support for old setuptools leaving ``PKG-INFO`` in the root of
the project directory.
1.4.1 (2016-11-07)
------------------
- Packaging only change (invalid sdist built for 1.4.0).
1.4.0 (2016-11-04)
------------------
- Relicense under MIT license: the PSF license is not suitable for
third-party libraries.
1.3.2 (2016-05-24)
------------------
- Packaging-only change (automate fix for wheel built for 1.3.1).
1.3.1 (2016-05-24)
------------------
- Packaging-only change (invalid wheel built for 1.3.0).
1.3.0 (2016-05-23)
------------------
- Update homepage URL to point to Launchpad, rather than PyPI.
- Add support for building wheels.
- Add support for Python 3.5.
- Drop support for Python 2.6 and 3.2.
1.2.1 (2014-01-02)
------------------
......@@ -221,13 +266,12 @@ Keywords: distribution sdist installed metadata
Platform: Unix
Platform: Windows
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
......
.bzrignore
CHANGES.txt
LICENSE.txt
README.txt
TODO.txt
setup.cfg
......@@ -58,10 +59,6 @@ pkginfo/tests/manky/namespaced/__init__.py
pkginfo/tests/manky/namespaced.manky-0.1.egg-info/PKG-INFO
pkginfo/tests/manky/namespaced/manky/__init__.py
pkginfo/tests/silly/PKG-INFO
pkginfo/tests/sneaky/NOT-A-PACKAGE.txt
pkginfo/tests/sneaky/setup.py
pkginfo/tests/sneaky/src/namespaced/__init__.py
pkginfo/tests/sneaky/src/namespaced/sneaky/__init__.py
pkginfo/tests/wonky/NOT-A-PACKAGE.txt
pkginfo/tests/wonky/EGG-INFO/PKG-INFO
pkginfo/tests/wonky/namespaced/__init__.py
......
from pkginfo.bdist import BDist
from pkginfo.develop import Develop
from pkginfo.distribution import Distribution
from pkginfo.index import Index
from pkginfo.installed import Installed
from pkginfo.sdist import SDist
from pkginfo.sdist import UnpackedSDist
from pkginfo.utils import get_metadata
from pkginfo.wheel import Wheel
from .bdist import BDist
from .develop import Develop
from .distribution import Distribution
from .index import Index
from .installed import Installed
from .sdist import SDist
from .sdist import UnpackedSDist
from .utils import get_metadata
from .wheel import Wheel
import os
import zipfile
from pkginfo.distribution import Distribution
from .distribution import Distribution
class BDist(Distribution):
......
......@@ -25,7 +25,7 @@ import optparse
import os
import sys
from pkginfo import get_metadata
from .utils import get_metadata
def _parse_options(args=None):
......@@ -39,7 +39,7 @@ def _parse_options(args=None):
)
parser.add_option("-d", "--download-url-prefix",
dest="download_url_prefix",
dest="download_url_prefix",
help="Download URL prefix",
)
......
......@@ -2,7 +2,7 @@ import os
import sys
import warnings
from pkginfo.distribution import Distribution
from .distribution import Distribution
def _gather_py2(top, candidates): #pragma NO COVER Py3k
def _filter(candidates, dirname, fnames):
......
from email.parser import Parser
from pkginfo._compat import StringIO
from pkginfo._compat import must_decode
from ._compat import StringIO
from ._compat import must_decode
def parse(fp):
......@@ -58,11 +58,17 @@ HEADER_ATTRS_1_2 = HEADER_ATTRS_1_1 + ( # PEP 345
HEADER_ATTRS_2_0 = HEADER_ATTRS_1_2 #XXX PEP 426?
HEADER_ATTRS_2_1 = HEADER_ATTRS_1_2 + ( # PEP 566
('Provides-Extra', 'provides_extras', True),
('Description-Content-Type', 'description_content_type', False)
)
HEADER_ATTRS = {
'1.0': HEADER_ATTRS_1_0,
'1.1': HEADER_ATTRS_1_1,
'1.2': HEADER_ATTRS_1_2,
'2.0': HEADER_ATTRS_2_0,
'2.1': HEADER_ATTRS_2_1,
}
class Distribution(object):
......@@ -94,6 +100,9 @@ class Distribution(object):
provides_dist = ()
obsoletes_dist = ()
project_urls = ()
# version 2.1
provides_extras = ()
description_content_type = None
def extractMetadata(self):
data = self.read()
......@@ -126,7 +135,11 @@ class Distribution(object):
value = get(msg, header_name)
if value != 'UNKNOWN':
setattr(self, attr_name, value)
body = msg.get_payload()
if body:
setattr(self, 'description', body)
def __iter__(self):
for header_name, attr_name, multiple in self._getHeaderAttrs():
yield attr_name
......
from pkginfo.distribution import Distribution
from .distribution import Distribution
class Index(dict):
......
......@@ -3,8 +3,8 @@ import os
import sys
import warnings
from pkginfo.distribution import Distribution
from pkginfo._compat import STRING_TYPES
from .distribution import Distribution
from ._compat import STRING_TYPES
class Installed(Distribution):
......
......@@ -2,7 +2,7 @@ import os
import tarfile
import zipfile
from pkginfo.distribution import Distribution
from .distribution import Distribution
class SDist(Distribution):
......
......@@ -18,12 +18,12 @@ def _checkClassifiers(testcase, installed):
testcase.assertEqual(list(installed.classifiers),
[
'Intended Audience :: Developers',
'License :: OSI Approved :: Python Software Foundation License',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
......
THIS IS NOT A PYTHON PACKAGE!!!!
It is meant to be added to sys.path for testing introspection of namespace
packages installed via setuptools.
from setuptools import setup, find_packages
setup(
name='namespaced.sneaky',
version='0.1',
description='Test namespaced packages with non-root egg-info.',
author='Tres Seaver',
author_email='tseaver@palladion.com',
long_description='Blah, blah.',
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['namespaced',],
install_requires=['setuptools'],
zip_safe=False,
)
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
# Dummy package inside the 'namespaced' namespace.
......@@ -14,15 +14,6 @@ class DevelopTests(unittest.TestCase):
develop = self._makeOne('.')
_checkSample(self, develop)
def test_ctor_w_path_nested_egg_info(self):
import os
dir, name = os.path.split(__file__)
subdir = os.path.join(dir, 'sneaky')
develop = self._makeOne(subdir)
self.assertEqual(develop.metadata_version, '1.0')
self.assertEqual(develop.name, 'namespaced.sneaky')
self.assertEqual(develop.version, '0.1')
def test_ctor_w_invalid_path(self):
import warnings
old_filters = warnings.filters[:]
......
......@@ -74,6 +74,14 @@ class DistributionTests(unittest.TestCase):
self.assertEqual(list(dist),
[x[1] for x in HEADER_ATTRS_1_2])
def test_parse_Metadata_Version_2_1(self):
from pkginfo.distribution import HEADER_ATTRS_2_1
dist = self._makeOne(None)
dist.parse('Metadata-Version: 2.1')
self.assertEqual(dist.metadata_version, '2.1')
self.assertEqual(list(dist),
[x[1] for x in HEADER_ATTRS_2_1])
def test_parse_Metadata_Version_unknown(self):
dist = self._makeOne(None)
dist.parse('Metadata-Version: 1.3')
......@@ -138,6 +146,16 @@ class DistributionTests(unittest.TestCase):
'This package enables integration with\n'
'foo servers.')
def test_parse_Description_in_payload(self):
dist = self._makeOne()
dist.parse('Foo: Bar\n'
'\n'
'This package enables integration with\n'
'foo servers.')
self.assertEqual(dist.description,
'This package enables integration with\n'
'foo servers.')
def test_parse_Keywords(self):
dist = self._makeOne()
dist.parse('Keywords: bar foo qux')
......
import os
from types import ModuleType
from pkginfo.bdist import BDist
from pkginfo.develop import Develop
from pkginfo.installed import Installed
from pkginfo.sdist import SDist
from pkginfo.wheel import Wheel
from .bdist import BDist
from .develop import Develop
from .installed import Installed
from .sdist import SDist
from .wheel import Wheel
def get_metadata(path_or_module, metadata_version=None):
""" Try to create a Distribution 'path_or_module'.
o 'path_or_module' may be a module object.
o If a string, 'path_or_module' may point to an sdist file, a bdist
file, an installed package, or a working checkout (if it contains
PKG-INFO).
o Return None if 'path_or_module' can't be parsed.
"""
if isinstance(path_or_module, ModuleType):
......
from io import StringIO
import os
import zipfile
from .distribution import Distribution
from .distribution import must_decode
from .distribution import parse
class Wheel(Distribution):
......@@ -41,9 +38,3 @@ class Wheel(Distribution):
archive.close()
raise ValueError('No METADATA in archive: %s' % fqn)
def parse(self, data):
super(Wheel, self).parse(data)
fp = StringIO(must_decode(data))
msg = parse(fp)
self.description = msg.get_payload()
[bdist_wheel]
universal = 1
[easy_install]
zip_ok = false
......@@ -12,5 +15,4 @@ dev = develop easy_install pkginfo[testing]
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
......@@ -20,24 +20,23 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
setup(
name='pkginfo',
version='1.2.1',
version='1.4.2',
description='Query metadatdata from sdists / bdists / installed packages.',
platforms=['Unix', 'Windows'],
long_description='\n\n'.join([README, CHANGES]),
keywords='distribution sdist installed metadata',
url='http://pypi.python.org/pypi/pkginfo/',
url='https://code.launchpad.net/~tseaver/pkginfo/trunk',
author='Tres Seaver, Agendaless Consulting',
author_email='tseaver@agendaless.com',
license='Python',
license='MIT',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: Python Software Foundation License',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
......
[tox]
envlist =
# py26,py27,py32,py33,pypy,cover
py26,py27,pypy,py32,py33,py34,pypy3,cover2,cover3,docs
py27,pypy,py33,py34,py35,pypy3,cover2,cover3,docs
[testenv]
commands =
......@@ -10,7 +9,7 @@ commands =
[testenv:cover2]
basepython =
python2.6
python2.7
commands =
python setup.py develop
python setup.py nosetests --with-xunit --with-xcoverage
......@@ -21,7 +20,7 @@ deps =
[testenv:cover3]
basepython =
python3.2
python3.3
commands =
python setup.py develop
python setup.py nosetests --with-xunit --with-xcoverage
......@@ -32,7 +31,7 @@ deps =
[testenv:docs]
basepython =
python2.6
python2.7
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment