From: DongHun Kwak Date: Tue, 29 Dec 2020 22:06:07 +0000 (+0900) Subject: Imported Upstream version 46.3.0 X-Git-Tag: upstream/46.3.0^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=509c733f34871b9cd6251d2209fe223a0392862f;p=platform%2Fupstream%2Fpython-setuptools.git Imported Upstream version 46.3.0 --- diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c1b062e..09a3be9 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 46.2.0 +current_version = 46.3.0 commit = True tag = True diff --git a/CHANGES.rst b/CHANGES.rst index 03c89be..9793453 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,11 @@ +v46.3.0 +------- + +* #2089: Package index functionality no longer attempts to remove an md5 fragment from the index URL. This functionality, added for distribute #163 is no longer relevant. +* #2041: Preserve file modes during pkg files copying, but clear read only flag for target afterwards. +* #2105: Filter ``2to3`` deprecation warnings from ``TestDevelop.test_2to3_user_mode``. + + v46.2.0 ------- @@ -6,7 +14,7 @@ v46.2.0 * #2075: Stop recognizing files ending with ``.dist-info`` as distribution metadata. * #2086: Deprecate 'use_2to3' functionality. Packagers are encouraged to use single-source solutions or build tool chains to manage conversions outside of setuptools. * #1698: Added documentation for ``build_meta`` (a bare minimum, not completed). -* #2082: Filter ``lib2to3`` ``PendingDeprecationWarning`` and ``DeprecationWarning`` in testes, +* #2082: Filter ``lib2to3`` ``PendingDeprecationWarning`` and ``DeprecationWarning`` in tests, because ``lib2to3`` is `deprecated in Python 3.9 `_. diff --git a/changelog.d/2041.bugfix.rst b/changelog.d/2041.bugfix.rst deleted file mode 100644 index 8db757d..0000000 --- a/changelog.d/2041.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Preserve file modes during pkg files copying, but clear read only flag for target afterwards. diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 0512731..edd3d2e 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -55,7 +55,7 @@ except NameError: FileExistsError = OSError from pkg_resources.extern import six -from pkg_resources.extern.six.moves import urllib, map, filter +from pkg_resources.extern.six.moves import map, filter # capture these to bypass sandboxing from os import utime @@ -2546,15 +2546,6 @@ class EntryPoint: return maps -def _remove_md5_fragment(location): - if not location: - return '' - parsed = urllib.parse.urlparse(location) - if parsed[-1].startswith('md5='): - return urllib.parse.urlunparse(parsed[:-1] + ('',)) - return location - - def _version_from_file(lines): """ Given an iterable of lines from a Metadata file, return @@ -2611,7 +2602,7 @@ class Distribution: self.parsed_version, self.precedence, self.key, - _remove_md5_fragment(self.location), + self.location, self.py_version or '', self.platform or '', ) diff --git a/pkg_resources/tests/test_working_set.py b/pkg_resources/tests/test_working_set.py index b3ca4ea..7a759bb 100644 --- a/pkg_resources/tests/test_working_set.py +++ b/pkg_resources/tests/test_working_set.py @@ -14,8 +14,8 @@ __metaclass__ = type def strip_comments(s): return '\n'.join( - l for l in s.split('\n') - if l.strip() and not l.strip().startswith('#') + line for line in s.split('\n') + if line.strip() and not line.strip().startswith('#') ) diff --git a/setup.cfg b/setup.cfg index 2f5525f..5495343 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ formats = zip [metadata] name = setuptools -version = 46.2.0 +version = 46.3.0 description = Easily download, build, install, upgrade, and uninstall Python packages author = Python Packaging Authority author_email = distutils-sig@python.org diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py index 9c77b51..6377d78 100644 --- a/setuptools/tests/__init__.py +++ b/setuptools/tests/__init__.py @@ -6,7 +6,7 @@ from setuptools.extern.six import PY2, PY3 __all__ = [ - 'fail_on_ascii', 'py2_only', 'py3_only' + 'fail_on_ascii', 'py2_only', 'py3_only', 'ack_2to3' ] @@ -16,3 +16,5 @@ fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale") py2_only = pytest.mark.skipif(not PY2, reason="Test runs on Python 2 only") py3_only = pytest.mark.skipif(not PY3, reason="Test runs on Python 3 only") + +ack_2to3 = pytest.mark.filterwarnings('ignore:2to3 support is deprecated') diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py index 792975f..bb89a86 100644 --- a/setuptools/tests/test_develop.py +++ b/setuptools/tests/test_develop.py @@ -17,6 +17,7 @@ import pytest from setuptools.command.develop import develop from setuptools.dist import Distribution +from setuptools.tests import ack_2to3 from . import contexts from . import namespaces @@ -65,6 +66,7 @@ class TestDevelop: @pytest.mark.skipif( in_virtualenv or in_venv, reason="Cannot run when invoked in a virtualenv or venv") + @ack_2to3 def test_2to3_user_mode(self, test_env): settings = dict( name='foo', diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 534392b..3044cbd 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -738,7 +738,7 @@ class TestSetupRequires: dep_2_0_url=dep_2_0_url, dep_2_0_sdist=dep_2_0_sdist, dep_2_0_python_requires=dep_2_0_python_requires, - ), 'utf-8') + ), 'utf-8') index_url = path_to_url(str(index)) with contexts.save_pkg_resources_state(): test_pkg = create_setup_requires_package( diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index 60d968f..4529689 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -9,9 +9,7 @@ from setuptools.extern.six.moves import urllib, http_client import mock import pytest -import pkg_resources import setuptools.package_index -from setuptools.tests.server import IndexServer from .textwrap import DALS @@ -114,43 +112,6 @@ class TestPackageIndex: url = 'file:///tmp/test_package_index' assert index.url_ok(url, True) - def test_links_priority(self): - """ - Download links from the pypi simple index should be used before - external download links. - https://bitbucket.org/tarek/distribute/issue/163 - - Usecase : - - someone uploads a package on pypi, a md5 is generated - - someone manually copies this link (with the md5 in the url) onto an - external page accessible from the package page. - - someone reuploads the package (with a different md5) - - while easy_installing, an MD5 error occurs because the external link - is used - -> Setuptools should use the link from pypi, not the external one. - """ - if sys.platform.startswith('java'): - # Skip this test on jython because binding to :0 fails - return - - # start an index server - server = IndexServer() - server.start() - index_url = server.base_url() + 'test_links_priority/simple/' - - # scan a test index - pi = setuptools.package_index.PackageIndex(index_url) - requirement = pkg_resources.Requirement.parse('foobar') - pi.find_packages(requirement) - server.stop() - - # the distribution has been found - assert 'foobar' in pi - # we have only one link, because links are compared without md5 - assert len(pi['foobar']) == 1 - # the link should be from the index - assert 'correct_md5' in pi['foobar'][0].location - def test_parse_bdist_wininst(self): parse = setuptools.package_index.parse_bdist_wininst @@ -221,11 +182,11 @@ class TestPackageIndex: ('+ubuntu_0', '+ubuntu.0'), ] versions = [ - [''.join([e, r, p, l]) for l in ll] + [''.join([e, r, p, loc]) for loc in locs] for e in epoch for r in releases for p in sum([pre, post, dev], ['']) - for ll in local] + for locs in local] for v, vc in versions: dists = list(setuptools.package_index.distros_for_url( 'http://example.com/example.zip#egg=example-' + v)) diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py index 0f77d8f..892fd12 100644 --- a/setuptools/tests/test_test.py +++ b/setuptools/tests/test_test.py @@ -10,6 +10,7 @@ import pytest from setuptools.command.test import test from setuptools.dist import Distribution +from setuptools.tests import ack_2to3 from .textwrap import DALS @@ -73,9 +74,6 @@ def quiet_log(): log.set_verbosity(0) -ack_2to3 = pytest.mark.filterwarnings('ignore:2to3 support is deprecated') - - @pytest.mark.usefixtures('sample_test', 'quiet_log') @ack_2to3 def test_test(capfd):