...
 
Commits (13)
``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
......
# see git-dpm(1) from git-dpm package
2c8242011042c4e8c29c5d0d7072b57a00fe7068
2c8242011042c4e8c29c5d0d7072b57a00fe7068
4ef9f9e718734de0e0d58f2759fc0586784afda7
4ef9f9e718734de0e0d58f2759fc0586784afda7
python-pkginfo_1.2.1.orig.tar.gz
3ac3d9610fddbeba432ce8a1a01c6a71a824d2fb
31072
debianTag="debian/%e%v"
patchedTag="patched/%e%v"
upstreamTag="upstream/%e%u"
python-pkginfo (1.2.1-2) UNRELEASED; urgency=medium
python-pkginfo (1.4.2-1) unstable; urgency=medium
[ Stefano Rivera ]
* Team upload.
* New upstream release.
* Upstream relicensed to MIT/Expat.
* Migrate from git-dpm to pure git-buildpackage (with PQ).
* Bump debhelper compat level to 10.
* Upstream dropped support for python 2.6.
* Bump Standards-Version to 4.1.3, no changes needed.
* Drop the "sneaky" test setup, it's no longer shipped.
* Fix typos in --help (and manpage).
* Fix CSS in HTML docs. (Sphinx 1.3 compatibility)
* Declare Rules-Requires-Root: no.
[ Ondřej Nový ]
* Fixed homepage (https)
* Fixed VCS URL (https)
* d/control: Set Vcs-* to salsa.debian.org
......@@ -7,7 +21,7 @@ python-pkginfo (1.2.1-2) UNRELEASED; urgency=medium
* d/watch: Use https protocol
* d/changelog: Remove trailing whitespaces
-- Ondřej Nový <novy@ondrej.org> Tue, 29 Mar 2016 22:16:07 +0200
-- Stefano Rivera <stefanor@debian.org> Mon, 19 Mar 2018 18:55:18 -0700
python-pkginfo (1.2.1-1) unstable; urgency=medium
......
......@@ -3,19 +3,20 @@ Section: python
Priority: optional
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Uploaders: Jan Dittberner <jandd@debian.org>
Build-Depends: debhelper (>= 9~),
Build-Depends: debhelper (>= 10),
dh-python,
python-all,
python3-all,
python-setuptools,
python3-setuptools,
python3-sphinx
Standards-Version: 3.9.6
X-Python-Version: >= 2.6
Standards-Version: 4.1.3
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.3
Homepage: https://pypi.python.org/pypi/pkginfo/
Vcs-Git: https://salsa.debian.org/python-team/modules/python-pkginfo.git
Vcs-Browser: https://salsa.debian.org/python-team/modules/python-pkginfo
Rules-Requires-Root: no
Package: python-pkginfo
Architecture: all
......
......@@ -4,60 +4,17 @@ Upstream-Contact: Tres Seaver <tseaver@agendaless.com>
Source: http://pypi.python.org/pypi/pkginfo/
Files: *
Copyright: 2009-2012 Tres Seaver, Agendaless Consulting
License: Python
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
.
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software
Foundation; All Rights Reserved" are retained in Python alone
or in any derivative version prepared by Licensee.
.
3. In the event Licensee prepares a derivative work that is based on or
incorporates Python or any part thereof, and wants to make the derivative work
available to others as provided herein, then Licensee hereby agrees to include
in any such work a brief summary of the changes made to Python.
.
4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES
NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT
NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF
MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY
INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF
MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF,
EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
.
6. This License Agreement will automatically terminate upon a material breach
of its terms and conditions.
.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote products
or services of Licensee, or any third party.
.
8. By copying, installing or otherwise using Python, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
Copyright: 2009-2018 Agendaless Consulting
License: Expat
Files: debian/*
Copyright: 2012 Jan Dittberner
License: MIT
Copyright (c) 2012 Jan Dittberner
.
2018 Stefano Rivera <stefanor@debian.org>
License: Expat
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
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
......@@ -66,10 +23,11 @@ License: MIT
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
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.
From ea9cf56572a39ef8c1dedae43576a5111cd9ca28 Mon Sep 17 00:00:00 2001
From: Jan Dittberner <jandd@debian.org>
Date: Wed, 30 Dec 2015 17:29:18 +0100
Subject: Disable tests failing in Debian build
......
From 2c8242011042c4e8c29c5d0d7072b57a00fe7068 Mon Sep 17 00:00:00 2001
From: Jan Dittberner <jandd@debian.org>
Date: Wed, 30 Dec 2015 18:41:17 +0100
Subject: Disable test test_ctor_w_package_no_PKG_INFO
......
From: Stefano Rivera <stefanor@debian.org>
Date: Mon, 19 Mar 2018 18:50:05 -0700
Subject: Fix typos in --help
Forwarded: https://code.launchpad.net/~stefanor/pkginfo/typo/+merge/341695
---
pkginfo/commandline.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkginfo/commandline.py b/pkginfo/commandline.py
index 575dbd1..b240218 100644
--- a/pkginfo/commandline.py
+++ b/pkginfo/commandline.py
@@ -10,8 +10,8 @@ o a source distribution: in this case, 'path' should point to an existing
o a binary distribution: in this case, 'path' should point to an existing
archive file (.egg)
-o a "develop" checkout: in ths case, 'path' should point to a directory
- intialized via 'setup.py develop' (under setuptools).
+o a "develop" checkout: in this case, 'path' should point to a directory
+ initialized via 'setup.py develop' (under setuptools).
o an installed package: in this case, 'path' should be the importable name
of the package.
From: Stefano Rivera <stefanor@debian.org>
Date: Mon, 19 Mar 2018 18:51:17 -0700
Subject: Sphinx: Alabaster has no default.css
Forwarded: https://code.launchpad.net/~stefanor/pkginfo/docs-theme/+merge/341696
---
docs/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/conf.py b/docs/conf.py
index 1fa02f5..0a819e0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -99,7 +99,7 @@ pygments_style = 'sphinx'
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
-html_style = 'default.css'
+#html_style = 'default.css'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
0001-Disable-tests-failing-in-Debian-build.patch
0002-Disable-test-test_ctor_w_package_no_PKG_INFO.patch
0003-Fix-typos-in-help.patch
0004-Sphinx-Alabaster-has-no-default.css.patch
.TH PKGINFO "1" "October 2012" "pkginfo" "User Commands"
.TH PKGINFO "1" "March 2018" "pkginfo" "User Commands"
.SH NAME
pkginfo \- print metadata for one or more Python package distributions
.SH SYNOPSIS
......@@ -16,8 +16,8 @@ Each 'path' entry can be one of the following:
- a binary distribution: in this case, 'path' should point to an existing
archive file (.egg)
.PP
- a "develop" checkout: in ths case, 'path' should point to a directory
intialized via 'setup.py develop' (under setuptools).
- a "develop" checkout: in this case, 'path' should point to a directory
initialized via 'setup.py develop' (under setuptools).
.PP
- an installed package: in this case, 'path' should be the importable name of
the package.
......
......@@ -10,10 +10,3 @@ export PYBUILD_AFTER_INSTALL_python3=rm -rf '{destdir}/{install_dir}/pkginfo/tes
override_dh_auto_build:
dh_auto_build --buildsystem=pybuild
python3 setup.py build_sphinx
override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
set -e -x; \
cd $(CURDIR)/pkginfo/tests/sneaky ; python setup.py egg_info ; cd ../../..
dh_auto_test
endif
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')
......
......@@ -52,12 +52,10 @@ class InstalledTests(unittest.TestCase):
installed = self._makeOne(types)
self.assertEqual(installed.package, types)
self.assertEqual(installed.package_name, 'types')
# This check does not work with Debian builds
#if sys.version_info[:2] >= (3, 3):
# self.assertEqual(installed.metadata_version, '1.1')
#else:
# self.assertEqual(installed.metadata_version, None)
self.assertEqual(installed.metadata_version, None)
if sys.version_info[:2] >= (3, 3):
self.assertEqual(installed.metadata_version, '1.1')
else:
self.assertEqual(installed.metadata_version, None)
def test_ctor_w_package_and_metadata_version(self):
import pkginfo
......
......@@ -120,12 +120,11 @@ class Test_get_metadata(unittest.TestCase):
def test_w_module_and_metadata_version(self):
import pkginfo
from pkginfo.tests import _checkSample
#from pkginfo.tests import _checkClassifiers
from pkginfo.tests import _checkClassifiers
dist = self._callFUT(pkginfo, metadata_version='1.2')
self.assertEqual(dist.metadata_version, '1.2')
_checkSample(self, dist)
# This test does not work with the Debian package build
#_checkClassifiers(self, dist)
_checkClassifiers(self, dist)
def test_w_package_name(self):
from pkginfo.tests import _defaultMetadataVersion
......@@ -137,12 +136,11 @@ class Test_get_metadata(unittest.TestCase):
def test_w_package_name_and_metadata_version(self):
from pkginfo.tests import _checkSample
#from pkginfo.tests import _checkClassifiers
from pkginfo.tests import _checkClassifiers
dist = self._callFUT('pkginfo', metadata_version='1.2')
self.assertEqual(dist.metadata_version, '1.2')
_checkSample(self, dist)
# This test does not work with the Debian package build
#_checkClassifiers(self, dist)
_checkClassifiers(self, dist)
def test_w_directory_no_EGG_INFO(self):
import os
......
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
......