Hello community,
here is the log from the commit of package python-pkginfo for
openSUSE:Leap:15.2 checked in at 2020-02-25 12:18:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-pkginfo (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-pkginfo.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pkginfo"
Tue Feb 25 12:18:10 2020 rev:12 rq:778880 version:1.5.0.1
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-pkginfo/python-pkginfo.changes
2020-01-15 15:51:35.627534295 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-pkginfo.new.26092/python-pkginfo.changes
2020-02-25 12:18:11.528557927 +0100
@@ -1,0 +2,38 @@
+Wed Jun 19 12:59:08 UTC 2019 - [email protected]
+
+- version update to 1.5.0.1
+ * Fix broken 'sdist'. LP #1639585.
+ * Fix 'console_scripts' entry point syntax. LP #1810734.
+ * Add support for JSON output from the CLI.
+ * Add support for installed wheels. E.g., 'dist-info/' dirs.
+ * Add support for Python 3.6 and 3.7.
+ * Drop support for Python 3.3.
+
+-------------------------------------------------------------------
+Wed Dec 19 00:05:38 UTC 2018 - Jan Engelhardt <[email protected]>
+
+- Use noun phrase in summary.
+
+-------------------------------------------------------------------
+Tue Dec 4 12:51:35 UTC 2018 - Matej Cepl <[email protected]>
+
+- Remove superfluous devel dependency for noarch package
+
+-------------------------------------------------------------------
+Sun May 20 16:11:28 UTC 2018 - [email protected]
+
+- fix failing tests with sed
+- enable tests
+
+-------------------------------------------------------------------
+Sat May 19 09:48:01 UTC 2018 - [email protected]
+
+- Update to version 1.4.2
+ - 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.
+
+-------------------------------------------------------------------
Old:
----
pkginfo-1.4.1.tar.gz
New:
----
pkginfo-1.5.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pkginfo.spec ++++++
--- /var/tmp/diff_new_pack.VurBXt/_old 2020-02-25 12:18:11.836558566 +0100
+++ /var/tmp/diff_new_pack.VurBXt/_new 2020-02-25 12:18:11.836558566 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pkginfo
#
-# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,33 +12,30 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
-# Tests are currently broken.
-%bcond_with tests
-
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pkginfo
-Version: 1.4.1
+Version: 1.5.0.1
Release: 0
-Summary: Query metadatdata from sdists / bdists / installed packages
+Summary: Python package for querying metadatdata from
sdists/bdists/installed packages
License: MIT
Group: Development/Languages/Python
-Url: http://pypi.python.org/pypi/pkginfo/
+URL: http://pypi.python.org/pypi/pkginfo/
Source:
https://files.pythonhosted.org/packages/source/p/pkginfo/pkginfo-%{version}.tar.gz
+BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-BuildRequires: %{python_module devel}
-BuildRequires: %{python_module setuptools}
-%if %{with tests}
-BuildRequires: %{python_module nose}
-%endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArch: noarch
Requires(post): update-alternatives
Requires(preun): update-alternatives
+Requires: python-setuptools
+BuildArch: noarch
+# SECTION test requirements
+BuildRequires: %{python_module nose}
+BuildRequires: %{python_module pytest}
+# /SECTION
%python_subpackages
%description
@@ -51,6 +48,8 @@
%prep
%setup -q -n pkginfo-%{version}
+# fix tests until fixed upstream
+sed -i "s|'2\.1'|None|" pkginfo/tests/test_installed.py
%build
%python_build
@@ -60,12 +59,8 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/pkginfo
-%if %{with tests}
%check
-%{python_expand $python setup.py develop --user
-$python setup.py test -q
-}
-%endif
+%pytest
%post
%python_install_alternative pkginfo
@@ -74,8 +69,8 @@
%python_uninstall_alternative pkginfo
%files %{python_files}
-%defattr(-,root,root,-)
-%doc README.txt CHANGES.txt LICENSE.txt TODO.txt
+%license LICENSE.txt
+%doc README.txt CHANGES.txt TODO.txt
%python_alternative %{_bindir}/pkginfo
%{python_sitelib}/pkginfo
%{python_sitelib}/pkginfo-%{version}-py*.egg-info
++++++ pkginfo-1.4.1.tar.gz -> pkginfo-1.5.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/.coveragerc
new/pkginfo-1.5.0.1/.coveragerc
--- old/pkginfo-1.4.1/.coveragerc 1970-01-01 01:00:00.000000000 +0100
+++ new/pkginfo-1.5.0.1/.coveragerc 2018-08-20 22:25:40.000000000 +0200
@@ -0,0 +1,3 @@
+[report]
+show_missing=1
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/CHANGES.txt
new/pkginfo-1.5.0.1/CHANGES.txt
--- old/pkginfo-1.4.1/CHANGES.txt 2016-11-07 15:37:31.000000000 +0100
+++ new/pkginfo-1.5.0.1/CHANGES.txt 2019-01-08 22:30:22.000000000 +0100
@@ -1,10 +1,40 @@
``pkginfo`` Changelog
=====================
+1.5.0.1 (2019-01-08)
+--------------------
+
+- Fix broken 'sdist'. LP #1639585.
+
+1.5.0 (2019-01-07)
+------------------
+
+- Fix 'console_scripts' entry point syntax. LP #1810734.
+
+- Add support for JSON output from the CLI.
+
+- Add support for installed wheels. E.g., 'dist-info/' dirs.
+
+- Add support for Python 3.6 and 3.7.
+
+- Drop support for Python 3.3.
+
+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 bulit for 1.4.0).
+- Packaging only change (invalid sdist built for 1.4.0).
1.4.0 (2016-11-04)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/PKG-INFO new/pkginfo-1.5.0.1/PKG-INFO
--- old/pkginfo-1.4.1/PKG-INFO 2016-11-07 15:41:39.000000000 +0100
+++ new/pkginfo-1.5.0.1/PKG-INFO 2019-01-08 22:31:51.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: pkginfo
-Version: 1.4.1
+Version: 1.5.0.1
Summary: Query metadatdata from sdists / bdists / installed packages.
Home-page: https://code.launchpad.net/~tseaver/pkginfo/trunk
Author: Tres Seaver, Agendaless Consulting
@@ -24,10 +24,40 @@
``pkginfo`` Changelog
=====================
+ 1.5.0.1 (2019-01-08)
+ --------------------
+
+ - Fix broken 'sdist'. LP #1639585.
+
+ 1.5.0 (2019-01-07)
+ ------------------
+
+ - Fix 'console_scripts' entry point syntax. LP #1810734.
+
+ - Add support for JSON output from the CLI.
+
+ - Add support for installed wheels. E.g., 'dist-info/' dirs.
+
+ - Add support for Python 3.6 and 3.7.
+
+ - Drop support for Python 3.3.
+
+ 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 bulit for 1.4.0).
+ - Packaging only change (invalid sdist built for 1.4.0).
1.4.0 (2016-11-04)
------------------
@@ -256,10 +286,12 @@
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Software Distribution
+Provides-Extra: testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/docs/conf.py
new/pkginfo-1.5.0.1/docs/conf.py
--- old/pkginfo-1.4.1/docs/conf.py 2015-01-02 19:35:32.000000000 +0100
+++ new/pkginfo-1.5.0.1/docs/conf.py 2018-08-20 22:05:50.000000000 +0200
@@ -99,7 +99,7 @@
# 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".
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pkginfo-1.4.1/docs/examples/mypackage-0.1.dist-info/METADATA
new/pkginfo-1.5.0.1/docs/examples/mypackage-0.1.dist-info/METADATA
--- old/pkginfo-1.4.1/docs/examples/mypackage-0.1.dist-info/METADATA
1970-01-01 01:00:00.000000000 +0100
+++ new/pkginfo-1.5.0.1/docs/examples/mypackage-0.1.dist-info/METADATA
2013-11-27 22:40:58.000000000 +0100
@@ -0,0 +1,15 @@
+Metadata-Version: 2.0
+Name: mypackage
+Version: 0.1
+Summary: UNKNOWN
+Home-page: http://pypi.python.org/pypi/pkginfo
+Author: Tres Seaver
+Author-email: [email protected]
+License: UNKNOWN
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Environment :: Console (Text Based)
+
+UNKNOWN
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/__init__.py
new/pkginfo-1.5.0.1/pkginfo/__init__.py
--- old/pkginfo-1.4.1/pkginfo/__init__.py 2013-11-27 23:02:22.000000000
+0100
+++ new/pkginfo-1.5.0.1/pkginfo/__init__.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,9 +1,9 @@
-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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/bdist.py
new/pkginfo-1.5.0.1/pkginfo/bdist.py
--- old/pkginfo-1.4.1/pkginfo/bdist.py 2012-12-28 23:01:10.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo/bdist.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,7 +1,7 @@
import os
import zipfile
-from pkginfo.distribution import Distribution
+from .distribution import Distribution
class BDist(Distribution):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/commandline.py
new/pkginfo-1.5.0.1/pkginfo/commandline.py
--- old/pkginfo-1.4.1/pkginfo/commandline.py 2015-01-02 18:51:57.000000000
+0100
+++ new/pkginfo-1.5.0.1/pkginfo/commandline.py 2018-08-20 22:13:54.000000000
+0200
@@ -10,8 +10,8 @@
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.
@@ -20,12 +20,14 @@
from configparser import ConfigParser
except ImportError: # pragma: NO COVER
from ConfigParser import ConfigParser
+from collections import OrderedDict
from csv import writer
+import json
import optparse
import os
import sys
-from pkginfo import get_metadata
+from .utils import get_metadata
def _parse_options(args=None):
@@ -39,7 +41,7 @@
)
parser.add_option("-d", "--download-url-prefix",
- dest="download_url_prefix",
+ dest="download_url_prefix",
help="Download URL prefix",
)
@@ -82,6 +84,11 @@
help="Output as INI",
)
+ parser.add_option("--json", dest="output", action="store_const",
+ const='json',
+ help="Output as JSON",
+ )
+
options, args = parser.parse_args(args)
if len(args)==0:
@@ -174,11 +181,32 @@
def finish(self):
self._parser.write(sys.stdout) # pragma: NO COVER
+class JSON(Base):
+ _fields = None
+ def __init__(self, options):
+ super(JSON, self).__init__(options)
+ self._mapping = OrderedDict()
+
+ def __call__(self, meta):
+ if self._fields is None:
+ self._fields = list(meta)
+ for field in self._fields:
+ value = getattr(meta, field)
+ if value and not isinstance(value, (tuple, list)):
+ value = str(value)
+ if field in self._mapping:
+ raise ValueError('Duplicate field: %(field)r' % locals())
+ self._mapping[field] = value
+
+ def finish(self):
+ json.dump(self._mapping, sys.stdout, indent=2)
+
_FORMATTERS = {
'simple': Simple,
'single': SingleLine,
'csv': CSV,
'ini': INI,
+ 'json': JSON,
}
def main(args=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/develop.py
new/pkginfo-1.5.0.1/pkginfo/develop.py
--- old/pkginfo-1.4.1/pkginfo/develop.py 2013-05-05 17:49:07.000000000
+0200
+++ new/pkginfo-1.5.0.1/pkginfo/develop.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,8 +1,9 @@
+import io
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):
@@ -40,6 +41,6 @@
for candidate in candidates:
path = os.path.join(candidate, 'PKG-INFO')
if os.path.exists(path):
- with open(path) as f:
+ with io.open(path, errors='ignore') as f:
return f.read()
warnings.warn('No PKG-INFO found for path: %s' % self.path)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/distribution.py
new/pkginfo-1.5.0.1/pkginfo/distribution.py
--- old/pkginfo-1.4.1/pkginfo/distribution.py 2013-11-27 22:57:07.000000000
+0100
+++ new/pkginfo-1.5.0.1/pkginfo/distribution.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,7 +1,7 @@
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_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 @@
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 @@
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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/index.py
new/pkginfo-1.5.0.1/pkginfo/index.py
--- old/pkginfo-1.4.1/pkginfo/index.py 2010-04-08 23:59:50.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/index.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,4 +1,4 @@
-from pkginfo.distribution import Distribution
+from .distribution import Distribution
class Index(dict):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/installed.py
new/pkginfo-1.5.0.1/pkginfo/installed.py
--- old/pkginfo-1.4.1/pkginfo/installed.py 2012-12-28 21:31:02.000000000
+0100
+++ new/pkginfo-1.5.0.1/pkginfo/installed.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,10 +1,11 @@
import glob
+import io
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):
@@ -48,6 +49,6 @@
else:
path = candidate
if os.path.exists(path):
- with open(path) as f:
+ with io.open(path, errors='ignore') as f:
return f.read()
warnings.warn('No PKG-INFO found for package: %s' % self.package_name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/sdist.py
new/pkginfo-1.5.0.1/pkginfo/sdist.py
--- old/pkginfo-1.4.1/pkginfo/sdist.py 2013-05-05 16:59:48.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/sdist.py 2018-08-20 22:05:50.000000000
+0200
@@ -1,8 +1,9 @@
+import io
import os
import tarfile
import zipfile
-from pkginfo.distribution import Distribution
+from .distribution import Distribution
class SDist(Distribution):
@@ -66,7 +67,8 @@
def read(self):
try:
- with open(os.path.join(self.filename, 'PKG-INFO')) as f:
+ pkg_info = os.path.join(self.filename, 'PKG-INFO')
+ with io.open(pkg_info, errors='ignore') as f:
return f.read()
except Exception as e:
raise ValueError('Could not load %s as an unpacked sdist: %s'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/__init__.py
new/pkginfo-1.5.0.1/pkginfo/tests/__init__.py
--- old/pkginfo-1.4.1/pkginfo/tests/__init__.py 2016-11-04 21:29:27.000000000
+0100
+++ new/pkginfo-1.5.0.1/pkginfo/tests/__init__.py 2018-08-20
22:20:07.000000000 +0200
@@ -21,9 +21,10 @@
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
@@ -32,7 +33,4 @@
def _defaultMetadataVersion():
- import sys
- if sys.version_info[:2] > (2, 6):
- return '1.1'
- return '1.0'
+ return '2.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/sneaky/NOT-A-PACKAGE.txt
new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/NOT-A-PACKAGE.txt
--- old/pkginfo-1.4.1/pkginfo/tests/sneaky/NOT-A-PACKAGE.txt 2013-05-05
17:20:31.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/NOT-A-PACKAGE.txt 1970-01-01
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-THIS IS NOT A PYTHON PACKAGE!!!!
-
-It is meant to be added to sys.path for testing introspection of namespace
-packages installed via setuptools.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/sneaky/setup.py
new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/setup.py
--- old/pkginfo-1.4.1/pkginfo/tests/sneaky/setup.py 2013-05-05
17:34:56.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/setup.py 1970-01-01
01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-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='[email protected]',
- long_description='Blah, blah.',
- packages=find_packages('src'),
- package_dir={'': 'src'},
- namespace_packages=['namespaced',],
- install_requires=['setuptools'],
- zip_safe=False,
-)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pkginfo-1.4.1/pkginfo/tests/sneaky/src/namespaced/__init__.py
new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/src/namespaced/__init__.py
--- old/pkginfo-1.4.1/pkginfo/tests/sneaky/src/namespaced/__init__.py
2013-05-05 17:20:14.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/src/namespaced/__init__.py
1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-# this is a namespace package
-try:
- import pkg_resources
- pkg_resources.declare_namespace(__name__)
-except ImportError:
- import pkgutil
- __path__ = pkgutil.extend_path(__path__, __name__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pkginfo-1.4.1/pkginfo/tests/sneaky/src/namespaced/sneaky/__init__.py
new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/src/namespaced/sneaky/__init__.py
--- old/pkginfo-1.4.1/pkginfo/tests/sneaky/src/namespaced/sneaky/__init__.py
2013-05-05 17:20:14.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/tests/sneaky/src/namespaced/sneaky/__init__.py
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-# Dummy package inside the 'namespaced' namespace.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/test_commandline.py
new/pkginfo-1.5.0.1/pkginfo/tests/test_commandline.py
--- old/pkginfo-1.4.1/pkginfo/tests/test_commandline.py 2015-01-02
18:51:01.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo/tests/test_commandline.py 2018-08-20
22:13:54.000000000 +0200
@@ -196,6 +196,62 @@
self.assertEqual(cp.get('foo-0.1', 'foo'), 'Foo')
self.assertEqual(cp.get('foo-0.1', 'bar'), 'Bar1\n\tBar2')
+class JSONtests(unittest.TestCase, _FormatterBase):
+
+ def _getTargetClass(self):
+ from pkginfo.commandline import JSON
+ return JSON
+
+ def _makeOne(self, options):
+ return self._getTargetClass()(options)
+
+ def test___call___duplicate_with_meta_and_fields(self):
+ json = self._makeOne(_Options(fields=('name',)))
+ meta = _Meta(name='foo', version='0.1', foo='Foo')
+ json._mapping['name'] = 'foo'
+ self.assertRaises(ValueError, json, meta)
+
+ def test___call___duplicate_with_meta_wo_fields(self):
+ json = self._makeOne(_Options(fields=None))
+ meta = _Meta(name='foo', version='0.1', foo='Foo')
+ json._mapping['name'] = 'foo'
+ self.assertRaises(ValueError, json, meta)
+
+ def test___call___wo_fields_wo_list(self):
+ from collections import OrderedDict
+
+ json = self._makeOne(_Options(fields=None))
+ meta = _Meta(name='foo', version='0.1', foo='Foo')
+ json(meta)
+ expected = OrderedDict([
+ ('foo', 'Foo'), ('name', 'foo'), ('version', '0.1')])
+ self.assertEqual(expected, json._mapping)
+
+ def test___call___w_fields_w_list(self):
+ from collections import OrderedDict
+
+ json = self._makeOne(_Options(fields=('foo', 'bar')))
+ meta = _Meta(name='foo', version='0.1',
+ foo='Foo', bar=['Bar1', 'Bar2'], baz='Baz')
+ json(meta)
+ expected = OrderedDict([
+ ('foo', 'Foo'), ('bar', ['Bar1', 'Bar2'])])
+ self.assertEqual(expected, json._mapping)
+
+ def test___call___output(self):
+ from collections import OrderedDict
+ import json as json_parser
+
+ json = self._makeOne(_Options(fields=None))
+ meta = _Meta(name='foo', version='0.1', foo='Foo')
+ json(meta)
+ output = self._capture_output(json.finish)
+ output = json_parser.loads(
+ output, object_pairs_hook=OrderedDict)
+ expected = OrderedDict([
+ ('foo', 'Foo'), ('name', 'foo'), ('version', '0.1')])
+ self.assertEqual(expected, output)
+
class Test_main(unittest.TestCase):
def _callFUT(self, args, monkey='simple'):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/test_develop.py
new/pkginfo-1.5.0.1/pkginfo/tests/test_develop.py
--- old/pkginfo-1.4.1/pkginfo/tests/test_develop.py 2013-05-05
17:46:33.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/tests/test_develop.py 2018-08-20
22:05:50.000000000 +0200
@@ -14,15 +14,6 @@
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[:]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/test_distribution.py
new/pkginfo-1.5.0.1/pkginfo/tests/test_distribution.py
--- old/pkginfo-1.4.1/pkginfo/tests/test_distribution.py 2013-10-09
23:35:46.000000000 +0200
+++ new/pkginfo-1.5.0.1/pkginfo/tests/test_distribution.py 2018-08-20
22:05:50.000000000 +0200
@@ -74,6 +74,14 @@
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')
@@ -137,6 +145,16 @@
self.assertEqual(dist.description,
'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()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/test_installed.py
new/pkginfo-1.5.0.1/pkginfo/tests/test_installed.py
--- old/pkginfo-1.4.1/pkginfo/tests/test_installed.py 2015-01-02
19:14:44.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo/tests/test_installed.py 2018-08-20
22:05:50.000000000 +0200
@@ -53,7 +53,7 @@
self.assertEqual(installed.package, types)
self.assertEqual(installed.package_name, 'types')
if sys.version_info[:2] >= (3, 3):
- self.assertEqual(installed.metadata_version, '1.1')
+ self.assertEqual(installed.metadata_version, '2.1')
else:
self.assertEqual(installed.metadata_version, None)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/tests/test_wheel.py
new/pkginfo-1.5.0.1/pkginfo/tests/test_wheel.py
--- old/pkginfo-1.4.1/pkginfo/tests/test_wheel.py 2013-11-27
22:55:22.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo/tests/test_wheel.py 2018-08-20
22:48:14.000000000 +0200
@@ -52,6 +52,16 @@
self._checkSample(wheel, filename)
self._checkClassifiers(wheel)
+ def test_ctor_w_installed_wheel(self):
+ import os
+ d, _ = os.path.split(__file__)
+ filename = (
+ '%s/../../docs/examples/mypackage-0.1.dist-info') % d
+ wheel = self._makeOne(filename)
+ self.assertEqual(wheel.metadata_version, '2.0')
+ self._checkSample(wheel, filename)
+ self._checkClassifiers(wheel)
+
def test_ctor_w_valid_wheel_and_metadata_version(self):
import os
d, _ = os.path.split(__file__)
@@ -62,3 +72,25 @@
self._checkSample(wheel, filename)
self._checkClassifiers(wheel)
+ def test_ctor_w_valid_installed_wheel(self):
+ import os
+ import shutil
+ import tempfile
+ import zipfile
+
+ d, _ = os.path.split(__file__)
+ filename = ('%s/../../docs/examples/'
+ 'mypackage-0.1-cp26-none-linux_x86_64.whl') % d
+
+ try:
+ # note: we mock a wheel installation by unzipping
+ test_dir = tempfile.mkdtemp()
+ with zipfile.ZipFile(filename) as zipf:
+ zipf.extractall(test_dir)
+ wheel = self._makeOne(filename)
+ self.assertEqual(wheel.metadata_version, '2.0')
+ self._checkSample(wheel, filename)
+ self._checkClassifiers(wheel)
+ finally:
+ if os.path.exists(test_dir):
+ shutil.rmtree(test_dir)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/utils.py
new/pkginfo-1.5.0.1/pkginfo/utils.py
--- old/pkginfo-1.4.1/pkginfo/utils.py 2013-11-27 23:04:36.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo/utils.py 2018-08-20 22:06:26.000000000
+0200
@@ -1,21 +1,21 @@
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):
@@ -52,6 +52,11 @@
if os.path.isdir(path_or_module):
try:
+ return Wheel(path_or_module, metadata_version)
+ except (ValueError, IOError): #pragma NO COVER
+ pass
+
+ try:
return Develop(path_or_module, metadata_version)
except (ValueError, IOError): #pragma NO COVER
pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo/wheel.py
new/pkginfo-1.5.0.1/pkginfo/wheel.py
--- old/pkginfo-1.4.1/pkginfo/wheel.py 2013-11-27 23:07:12.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo/wheel.py 2018-08-20 22:50:49.000000000
+0200
@@ -1,4 +1,4 @@
-from io import StringIO
+import io
import os
import zipfile
@@ -26,8 +26,21 @@
def read_file(name):
return archive.read(name)
+
+ close = archive.close
+
+ elif fqn.endswith('.dist-info'):
+ names = [os.path.join(fqn, p) for p in os.listdir(fqn)]
+
+ def read_file(name):
+ with io.open(name, mode='rb') as inf:
+ return inf.read()
+
+ close = lambda : None
+
else:
- raise ValueError('Not a known archive format: %s' % fqn)
+ raise ValueError('Not a known wheel archive format or '
+ 'installed .dist-info: %s' % fqn)
try:
tuples = [x.split('/') for x in names if 'METADATA' in x]
@@ -38,12 +51,12 @@
if b'Metadata-Version' in data:
return data
finally:
- archive.close()
+ close()
raise ValueError('No METADATA in archive: %s' % fqn)
def parse(self, data):
super(Wheel, self).parse(data)
- fp = StringIO(must_decode(data))
+ fp = io.StringIO(must_decode(data))
msg = parse(fp)
self.description = msg.get_payload()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo.egg-info/PKG-INFO
new/pkginfo-1.5.0.1/pkginfo.egg-info/PKG-INFO
--- old/pkginfo-1.4.1/pkginfo.egg-info/PKG-INFO 2016-11-07 15:41:38.000000000
+0100
+++ new/pkginfo-1.5.0.1/pkginfo.egg-info/PKG-INFO 2019-01-08
22:31:51.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: pkginfo
-Version: 1.4.1
+Version: 1.5.0.1
Summary: Query metadatdata from sdists / bdists / installed packages.
Home-page: https://code.launchpad.net/~tseaver/pkginfo/trunk
Author: Tres Seaver, Agendaless Consulting
@@ -24,10 +24,40 @@
``pkginfo`` Changelog
=====================
+ 1.5.0.1 (2019-01-08)
+ --------------------
+
+ - Fix broken 'sdist'. LP #1639585.
+
+ 1.5.0 (2019-01-07)
+ ------------------
+
+ - Fix 'console_scripts' entry point syntax. LP #1810734.
+
+ - Add support for JSON output from the CLI.
+
+ - Add support for installed wheels. E.g., 'dist-info/' dirs.
+
+ - Add support for Python 3.6 and 3.7.
+
+ - Drop support for Python 3.3.
+
+ 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 bulit for 1.4.0).
+ - Packaging only change (invalid sdist built for 1.4.0).
1.4.0 (2016-11-04)
------------------
@@ -256,10 +286,12 @@
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Software Distribution
+Provides-Extra: testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/pkginfo.egg-info/SOURCES.txt
new/pkginfo-1.5.0.1/pkginfo.egg-info/SOURCES.txt
--- old/pkginfo-1.4.1/pkginfo.egg-info/SOURCES.txt 2016-11-07
15:41:39.000000000 +0100
+++ new/pkginfo-1.5.0.1/pkginfo.egg-info/SOURCES.txt 2019-01-08
22:31:51.000000000 +0100
@@ -1,4 +1,5 @@
.bzrignore
+.coveragerc
CHANGES.txt
LICENSE.txt
README.txt
@@ -24,6 +25,7 @@
docs/examples/mypackage-0.1/README.txt
docs/examples/mypackage-0.1/setup.cfg
docs/examples/mypackage-0.1/setup.py
+docs/examples/mypackage-0.1.dist-info/METADATA
pkginfo/__init__.py
pkginfo/_compat.py
pkginfo/bdist.py
@@ -59,10 +61,6 @@
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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/setup.cfg new/pkginfo-1.5.0.1/setup.cfg
--- old/pkginfo-1.4.1/setup.cfg 2016-11-07 15:41:39.000000000 +0100
+++ new/pkginfo-1.5.0.1/setup.cfg 2019-01-08 22:31:52.000000000 +0100
@@ -15,5 +15,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/setup.py new/pkginfo-1.5.0.1/setup.py
--- old/pkginfo-1.4.1/setup.py 2016-11-07 15:37:38.000000000 +0100
+++ new/pkginfo-1.5.0.1/setup.py 2019-01-08 22:28:44.000000000 +0100
@@ -20,7 +20,7 @@
setup(
name='pkginfo',
- version='1.4.1',
+ version='1.5.0.1',
description='Query metadatdata from sdists / bdists / installed packages.',
platforms=['Unix', 'Windows'],
long_description='\n\n'.join([README, CHANGES]),
@@ -30,22 +30,23 @@
author_email='[email protected]',
license='MIT',
classifiers=[
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: MIT License',
- 'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.7',
- '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',
- 'Topic :: System :: Software Distribution',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Topic :: System :: Software Distribution',
],
entry_points={
- 'console_scripts': [
- ['pkginfo = pkginfo.commandline:main']
- ]
+ 'console_scripts': [
+ 'pkginfo = pkginfo.commandline:main',
+ ]
},
packages=['pkginfo', 'pkginfo.tests'],
**extras
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pkginfo-1.4.1/tox.ini new/pkginfo-1.5.0.1/tox.ini
--- old/pkginfo-1.4.1/tox.ini 2016-05-24 00:03:53.000000000 +0200
+++ new/pkginfo-1.5.0.1/tox.ini 2018-08-20 22:19:23.000000000 +0200
@@ -1,17 +1,16 @@
[tox]
envlist =
- py27,pypy,py33,py34,py35,pypy3,cover2,cover3,docs
+ py27,pypy,py34,py35,py36,py37,pypy3,cover2,cover3,docs
[testenv]
+usedevelop = true
commands =
- python setup.py develop
python setup.py test -q
[testenv:cover2]
basepython =
python2.7
commands =
- python setup.py develop
python setup.py nosetests --with-xunit --with-xcoverage
deps =
nose
@@ -20,9 +19,8 @@
[testenv:cover3]
basepython =
- python3.3
+ python3.7
commands =
- python setup.py develop
python setup.py nosetests --with-xunit --with-xcoverage
deps =
nose
@@ -37,8 +35,3 @@
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
deps =
Sphinx
-
-# we separate coverage into its own testenv because a) "last run wins" wrt
-# cobertura jenkins reporting and b) pypy and jython can't handle any
-# combination of versions of coverage and nosexcover that i can find.
-