Imported Upstream version 46.3.0 upstream/46.3.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:06:07 +0000 (07:06 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:06:07 +0000 (07:06 +0900)
.bumpversion.cfg
CHANGES.rst
changelog.d/2041.bugfix.rst [deleted file]
pkg_resources/__init__.py
pkg_resources/tests/test_working_set.py
setup.cfg
setuptools/tests/__init__.py
setuptools/tests/test_develop.py
setuptools/tests/test_easy_install.py
setuptools/tests/test_packageindex.py
setuptools/tests/test_test.py

index c1b062e4d91cba7b35b69ae3dee41e3116acf391..09a3be97e063b31b57e829c33f794075a9838886 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 46.2.0
+current_version = 46.3.0
 commit = True
 tag = True
 
index 03c89be6c565f142837a3b311c220b94acbbe467..97934531c78ab62a616a91263ba93a100a6ca264 100644 (file)
@@ -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 <https://bugs.python.org/issue40360>`_.
 
 
diff --git a/changelog.d/2041.bugfix.rst b/changelog.d/2041.bugfix.rst
deleted file mode 100644 (file)
index 8db757d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Preserve file modes during pkg files copying, but clear read only flag for target afterwards.
index 0512731d9f994e6176c3f7704ec92c2ba93298ac..edd3d2e8c64011f00be96896af34d0aae9e5a653 100644 (file)
@@ -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 '',
         )
index b3ca4ea8e4c662150eec22ce45976f6fa2db2519..7a759bbb3facdbac7f57e67e895a93aea0922434 100644 (file)
@@ -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('#')
     )
 
 
index 2f5525f3c5324d59425669561cc568bcc8b10e59..54953432695e1fbf1235932f455bd7ae642333bd 100644 (file)
--- 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
index 9c77b51f8dbef00c6d2f78b3ee34beabf33ee19f..6377d7857de1964a2165906ff31c3547cf46a203 100644 (file)
@@ -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')
index 792975fd14ae38235827ccd1503e327c1708930b..bb89a865b964d8aa4892f49570fd9bb2364d0d2c 100644 (file)
@@ -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',
index 534392b99d7ac6bd884fa1dad8935210b4a7c83f..3044cbd098d169c54b6359743d8bd76a2dff1e5c 100644 (file)
@@ -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(
index 60d968fdfac498bcf95df4b698f8b3e9f27f8fd1..452968973c855c6b039395781df08ed10bc88d86 100644 (file)
@@ -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))
index 0f77d8ff3d2c66b4dc21122e4e1821d7d00f9541..892fd120d97a329dce2e9534afd10855cb3f7f57 100644 (file)
@@ -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):