commit python-importlib-metadata for openSUSE:Factory
Hello community, here is the log from the commit of package python-importlib-metadata for openSUSE:Factory checked in at 2019-08-09 16:51:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-importlib-metadata (Old) and /work/SRC/openSUSE:Factory/.python-importlib-metadata.new.9556 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-importlib-metadata" Fri Aug 9 16:51:40 2019 rev:6 rq:721543 version:0.19 Changes: -------- --- /work/SRC/openSUSE:Factory/python-importlib-metadata/python-importlib-metadata.changes 2019-08-07 13:53:53.440857836 +0200 +++ /work/SRC/openSUSE:Factory/.python-importlib-metadata.new.9556/python-importlib-metadata.changes 2019-08-09 16:51:41.961492925 +0200 @@ -1,0 +2,9 @@ +Wed Aug 7 14:15:47 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com> + +- update to 0.19 + * restrain over-eager egg metadata resolution. + * Add support for entry points with colons in the name. + * Parse entry points case sensitively. + * Add a version constraint on the backport configparser package + +------------------------------------------------------------------- Old: ---- importlib_metadata-0.17.tar.gz New: ---- importlib_metadata-0.19.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-importlib-metadata.spec ++++++ --- /var/tmp/diff_new_pack.rge5Hm/_old 2019-08-09 16:51:42.641492762 +0200 +++ /var/tmp/diff_new_pack.rge5Hm/_new 2019-08-09 16:51:42.641492762 +0200 @@ -21,7 +21,7 @@ %define skip_python3 1 %endif Name: python-importlib-metadata -Version: 0.17 +Version: 0.19 Release: 0 Summary: Tool to read metadata from Python packages License: Apache-2.0 ++++++ importlib_metadata-0.17.tar.gz -> importlib_metadata-0.19.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/PKG-INFO new/importlib_metadata-0.19/PKG-INFO --- old/importlib_metadata-0.17/PKG-INFO 2019-05-30 02:45:00.000000000 +0200 +++ new/importlib_metadata-0.19/PKG-INFO 2019-07-28 19:52:18.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: importlib_metadata -Version: 0.17 +Version: 0.19 Summary: Read metadata from Python packages Home-page: http://importlib-metadata.readthedocs.io/ Author: Barry Warsaw @@ -51,4 +51,5 @@ Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 2 Requires-Python: >=2.7,!=3.0,!=3.1,!=3.2,!=3.3 +Provides-Extra: testing Provides-Extra: docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/__init__.py new/importlib_metadata-0.19/importlib_metadata/__init__.py --- old/importlib_metadata-0.17/importlib_metadata/__init__.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/__init__.py 2019-07-28 19:51:04.000000000 +0200 @@ -1,6 +1,7 @@ from __future__ import unicode_literals, absolute_import import io +import os import re import abc import csv @@ -22,6 +23,7 @@ NotADirectoryError, PermissionError, pathlib, + PYPY_OPEN_BUG, ModuleNotFoundError, MetaPathFinder, email_message_from_string, @@ -104,7 +106,9 @@ @classmethod def _from_text(cls, text): - config = ConfigParser() + config = ConfigParser(delimiters='=') + # case sensitive: https://stackoverflow.com/q/1611799/812183 + config.optionxform = str try: config.read_string(text) except AttributeError: # pragma: nocover @@ -337,7 +341,6 @@ This finder supplies only a find_distributions() method for versions of Python that do not have a PathFinder find_distributions(). """ - search_template = r'(?:{pattern}(-.*)?\.(dist|egg)-info|EGG-INFO)' def find_distributions(self, name=None, path=None): """ @@ -364,22 +367,31 @@ @staticmethod def _switch_path(path): - with suppress(Exception): - return zipp.Path(path) + if not PYPY_OPEN_BUG or os.path.isfile(path): # pragma: no branch + with suppress(Exception): + return zipp.Path(path) return pathlib.Path(path) @classmethod - def _predicate(cls, pattern, root, item): - return re.match(pattern, str(item.name), flags=re.IGNORECASE) + def _matches_info(cls, normalized, item): + template = r'{pattern}(-.*)?\.(dist|egg)-info' + manifest = template.format(pattern=normalized) + return re.match(manifest, item.name, flags=re.IGNORECASE) + + @classmethod + def _matches_legacy(cls, normalized, item): + template = r'{pattern}-.*\.egg[\\/]EGG-INFO' + manifest = template.format(pattern=normalized) + return re.search(manifest, str(item), flags=re.IGNORECASE) @classmethod def _search_path(cls, root, pattern): if not root.is_dir(): return () normalized = pattern.replace('-', '_') - matcher = cls.search_template.format(pattern=normalized) return (item for item in root.iterdir() - if cls._predicate(matcher, root, item)) + if cls._matches_info(normalized, item) + or cls._matches_legacy(normalized, item)) class PathDistribution(Distribution): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/_compat.py new/importlib_metadata-0.19/importlib_metadata/_compat.py --- old/importlib_metadata-0.17/importlib_metadata/_compat.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/_compat.py 2019-07-28 19:51:04.000000000 +0200 @@ -86,3 +86,6 @@ if sys.version_info < (3,) else email.message_from_string ) + +# https://bitbucket.org/pypy/pypy/issues/3021/ioopen-directory-leaks-a-file-de... +PYPY_OPEN_BUG = getattr(sys, 'pypy_version_info', (9, 9, 9))[:3] <= (7, 1, 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/docs/changelog.rst new/importlib_metadata-0.19/importlib_metadata/docs/changelog.rst --- old/importlib_metadata-0.17/importlib_metadata/docs/changelog.rst 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/docs/changelog.rst 2019-07-28 19:51:04.000000000 +0200 @@ -2,6 +2,16 @@ importlib_metadata NEWS ========================= +0.19 +==== +* Restrain over-eager egg metadata resolution. +* Add support for entry points with colons in the name. Closes #75. + +0.18 +==== +* Parse entry points case sensitively. Closes #68 +* Add a version constraint on the backport configparser package. Closes #66 + 0.17 ==== * Fix a permission problem in the tests on Windows. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/docs/conf.py new/importlib_metadata-0.19/importlib_metadata/docs/conf.py --- old/importlib_metadata-0.17/importlib_metadata/docs/conf.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/docs/conf.py 2019-07-28 19:51:04.000000000 +0200 @@ -92,17 +92,6 @@ # html_theme = 'default' -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - # Custom sidebar templates, must be a dictionary that maps document names # to template names. # Binary files old/importlib_metadata-0.17/importlib_metadata/tests/data/example-21.12-py3-none-any.whl and new/importlib_metadata-0.19/importlib_metadata/tests/data/example-21.12-py3-none-any.whl differ Binary files old/importlib_metadata-0.17/importlib_metadata/tests/data/example-21.12-py3.6.egg and new/importlib_metadata-0.19/importlib_metadata/tests/data/example-21.12-py3.6.egg differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/tests/fixtures.py new/importlib_metadata-0.19/importlib_metadata/tests/fixtures.py --- old/importlib_metadata-0.17/importlib_metadata/tests/fixtures.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/tests/fixtures.py 2019-07-28 19:51:04.000000000 +0200 @@ -83,6 +83,7 @@ "entry_points.txt": """ [entries] main = mod:main + ns:sub = mod:main """ }, "mod.py": """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/tests/test_main.py new/importlib_metadata-0.19/importlib_metadata/tests/test_main.py --- old/importlib_metadata-0.17/importlib_metadata/tests/test_main.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/tests/test_main.py 2019-07-28 19:51:04.000000000 +0200 @@ -49,6 +49,11 @@ ep = entries['main'] self.assertEqual(ep.load().__name__, "main") + def test_entrypoint_with_colon_in_name(self): + entries = dict(entry_points()['entries']) + ep = entries['ns:sub'] + self.assertEqual(ep.value, 'mod:main') + def test_resolve_without_attr(self): ep = EntryPoint( name='ep', @@ -167,8 +172,16 @@ class DirectoryTest(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase): - def test(self): + def test_egg_info(self): # make an `EGG-INFO` directory that's unrelated self.site_dir.joinpath('EGG-INFO').mkdir() # used to crash with `IsADirectoryError` - self.assertIsNone(version('unknown-package')) + with self.assertRaises(PackageNotFoundError): + version('unknown-package') + + def test_egg(self): + egg = self.site_dir.joinpath('foo-3.6.egg') + egg.mkdir() + with self.add_sys_path(egg): + with self.assertRaises(PackageNotFoundError): + version('foo') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata/tests/test_zip.py new/importlib_metadata-0.19/importlib_metadata/tests/test_zip.py --- old/importlib_metadata-0.17/importlib_metadata/tests/test_zip.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata/tests/test_zip.py 2019-07-28 19:51:04.000000000 +0200 @@ -1,7 +1,7 @@ import sys import unittest -from .. import distribution, entry_points, files, version +from .. import distribution, entry_points, files, PackageNotFoundError, version try: from importlib.resources import path @@ -30,10 +30,16 @@ def test_zip_version(self): self.assertEqual(version('example'), '21.12') + def test_zip_version_does_not_match(self): + with self.assertRaises(PackageNotFoundError): + version('definitely-not-installed') + def test_zip_entry_points(self): scripts = dict(entry_points()['console_scripts']) entry_point = scripts['example'] self.assertEqual(entry_point.value, 'example:main') + entry_point = scripts['Example'] + self.assertEqual(entry_point.value, 'example:main') def test_missing_metadata(self): self.assertIsNone(distribution('example').read_text('does not exist')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata.egg-info/PKG-INFO new/importlib_metadata-0.19/importlib_metadata.egg-info/PKG-INFO --- old/importlib_metadata-0.17/importlib_metadata.egg-info/PKG-INFO 2019-05-30 02:45:00.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata.egg-info/PKG-INFO 2019-07-28 19:52:18.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: importlib-metadata -Version: 0.17 +Version: 0.19 Summary: Read metadata from Python packages Home-page: http://importlib-metadata.readthedocs.io/ Author: Barry Warsaw @@ -51,4 +51,5 @@ Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 2 Requires-Python: >=2.7,!=3.0,!=3.1,!=3.2,!=3.3 +Provides-Extra: testing Provides-Extra: docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/importlib_metadata.egg-info/requires.txt new/importlib_metadata-0.19/importlib_metadata.egg-info/requires.txt --- old/importlib_metadata-0.17/importlib_metadata.egg-info/requires.txt 2019-05-30 02:45:00.000000000 +0200 +++ new/importlib_metadata-0.19/importlib_metadata.egg-info/requires.txt 2019-07-28 19:52:18.000000000 +0200 @@ -2,12 +2,16 @@ [:python_version < "3"] contextlib2 -configparser +configparser>=3.5 [:python_version == "3.4.*" or python_version < "3"] pathlib2 [docs] sphinx -docutils==0.12 rst.linker + +[testing] + +[testing:python_version < "3.7"] +importlib_resources diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/prepare/example/setup.py new/importlib_metadata-0.19/prepare/example/setup.py --- old/importlib_metadata-0.17/prepare/example/setup.py 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/prepare/example/setup.py 2019-07-28 19:51:04.000000000 +0200 @@ -5,6 +5,6 @@ license='Apache Software License', packages=['example'], entry_points={ - 'console_scripts': ['example = example:main'], + 'console_scripts': ['example = example:main', 'Example=example:main'], }, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/setup.cfg new/importlib_metadata-0.19/setup.cfg --- old/importlib_metadata-0.17/setup.cfg 2019-05-30 02:45:00.000000000 +0200 +++ new/importlib_metadata-0.19/setup.cfg 2019-07-28 19:52:18.000000000 +0200 @@ -16,11 +16,12 @@ [options] python_requires = >=2.7,!=3.0,!=3.1,!=3.2,!=3.3 +setup_requires = setuptools-scm install_requires = zipp>=0.5 pathlib2; python_version=='3.4.*' or python_version < '3' contextlib2; python_version < '3' - configparser; python_version < '3' + configparser>=3.5; python_version < '3' packages = find: [options.package_data] @@ -46,9 +47,10 @@ universal = 1 [options.extras_require] +testing = + importlib_resources; python_version < "3.7" docs = sphinx - docutils==0.12 rst.linker [egg_info] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/importlib_metadata-0.17/tox.ini new/importlib_metadata-0.19/tox.ini --- old/importlib_metadata-0.17/tox.ini 2019-05-30 02:44:36.000000000 +0200 +++ new/importlib_metadata-0.19/tox.ini 2019-07-28 19:51:04.000000000 +0200 @@ -26,12 +26,8 @@ LC_* PYV deps = - cov,diffcov: coverage>=4.5 - diffcov: diff_cover - importlib_resources; python_version < "3.7" - py27: contextlib2 - pip >= 18 - packaging + cov,diffcov: coverage>=4.5 + diffcov: diff_cover setenv = cov: COVERAGE_PROCESS_START={[coverage]rcfile} cov: COVERAGE_OPTIONS="-p" @@ -40,6 +36,8 @@ py34,py35,py36,py37,py38: PYV=3 # workaround deprecation warnings in pip's vendored packages PYTHONWARNINGS=ignore:Using or importing the ABCs:DeprecationWarning:pip._vendor +extras = + testing [testenv:qa] @@ -51,6 +49,7 @@ mypy flake8 flufl.flake8 +extras = [testenv:docs]
participants (1)
-
root