Imported Upstream version 67.5.0 upstream/67.5.0
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:03:01 +0000 (17:03 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:03:01 +0000 (17:03 +0900)
.bumpversion.cfg
.coveragerc
CHANGES.rst
docs/conf.py
docs/pkg_resources.rst
pkg_resources/__init__.py
pytest.ini
setup.cfg
setuptools/tests/contexts.py

index f92513aa4c76109810173e069e2bf76367ad50dc..9b4a0540e43eabea00756b650e99e991a67b3f8b 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 67.4.0
+current_version = 67.5.0
 commit = True
 tag = True
 
index aaecd6833562cf37033774d864dbfa9e31624e51..0402a8c61fe1b2b69e1d6c1802db7e95bac73157 100644 (file)
@@ -2,7 +2,8 @@
 omit =
        # leading `*/` for pytest-dev/pytest-cov#456
        */.tox/*
-       */pep517-build-env-*
+disable_warnings =
+       couldnt-parse
 
        # local
        */_validate_pyproject/*  # generated code, tested in `validate-pyproject`
index 6466071e9a2cac018dd79f14c6ef12faa4e886ac..44d0e3519d9c1916e6b171e33d7cd062da4a81e2 100644 (file)
@@ -1,3 +1,12 @@
+v67.5.0
+-------
+
+
+Changes
+^^^^^^^
+* #3843: Although pkg_resources has been discouraged for use, some projects still consider pkg_resources viable for usage. This change makes it clear that pkg_resources should not be used, emitting a DeprecationWarning when imported.
+
+
 v67.4.0
 -------
 
index 831fcc89da7656d466db56498882311ed3426fba..716b899342b346dc5bfd717c522b81e7ab2e457e 100644 (file)
@@ -100,16 +100,19 @@ intersphinx_mapping = {
 # Preserve authored syntax for defaults
 autodoc_preserve_defaults = True
 
-intersphinx_mapping.update({
-    'pip': ('https://pip.pypa.io/en/latest', None),
-    'build': ('https://pypa-build.readthedocs.io/en/latest', None),
-    'PyPUG': ('https://packaging.python.org/en/latest/', None),
-    'packaging': ('https://packaging.pypa.io/en/latest/', None),
-    'twine': ('https://twine.readthedocs.io/en/stable/', None),
-    'importlib-resources': (
-        'https://importlib-resources.readthedocs.io/en/latest', None
-    ),
-})
+intersphinx_mapping.update(
+    {
+        'pip': ('https://pip.pypa.io/en/latest', None),
+        'build': ('https://pypa-build.readthedocs.io/en/latest', None),
+        'PyPUG': ('https://packaging.python.org/en/latest/', None),
+        'packaging': ('https://packaging.pypa.io/en/latest/', None),
+        'twine': ('https://twine.readthedocs.io/en/stable/', None),
+        'importlib-resources': (
+            'https://importlib-resources.readthedocs.io/en/latest',
+            None,
+        ),
+    }
+)
 
 # Support tooltips on references
 extensions += ['hoverxref.extension']
@@ -223,7 +226,7 @@ towncrier_draft_include_empty = False
 extensions += ['jaraco.tidelift']
 
 # Add icons (aka "favicons") to documentation
-extensions += ['sphinx-favicon']
+extensions += ['sphinx_favicon']
 html_static_path = ['images']  # should contain the folder with icons
 
 # Add support for nice Not Found 404 pages
@@ -236,13 +239,13 @@ favicons = [
         "rel": "icon",
         "type": "image/svg+xml",
         "static-file": "logo-symbol-only.svg",
-        "sizes": "any"
+        "sizes": "any",
     },
     {  # Version with thicker strokes for better visibility at smaller sizes
         "rel": "icon",
         "type": "image/svg+xml",
         "static-file": "favicon.svg",
-        "sizes": "16x16 24x24 32x32 48x48"
+        "sizes": "16x16 24x24 32x32 48x48",
     },
     # rel="apple-touch-icon" does not support SVG yet
 ]
index 40e5e6f8adfff9418a93c46bd4b293de48cbf3ff..fcb91b7a05484db8ddacba1ad26bde3e515bce98 100644 (file)
@@ -11,12 +11,13 @@ subpackages, and APIs for managing Python's current "working set" of active
 packages.
 
 .. attention::
-   Use of ``pkg_resources`` is discouraged in favor of
+   Use of ``pkg_resources`` is deprecated in favor of
    `importlib.resources <https://docs.python.org/3/library/importlib.html#module-importlib.resources>`_,
    `importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`_,
    and their backports (:pypi:`importlib_resources`,
    :pypi:`importlib_metadata`).
-   Please consider using those libraries instead of pkg_resources.
+   Users should refrain from new usage of ``pkg_resources`` and
+   should work to port to importlib-based solutions.
 
 
 --------
index 1eb3f9e2d8c1d76f5466c1b007ddf411396e34e7..e08d17f42372683fececdfc10c935f217bc79968 100644 (file)
@@ -12,6 +12,12 @@ The package resource API is designed to work with normal filesystem packages,
 .egg files, and unpacked .egg files.  It can also work in a limited way with
 .zip files and with custom PEP 302 loaders that support the ``get_data()``
 method.
+
+This module is deprecated. Users are directed to
+`importlib.resources <https://docs.python.org/3/library/importlib.resources.html>`_
+and
+`importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`_
+instead.
 """
 
 import sys
@@ -112,6 +118,9 @@ _namespace_handlers = None
 _namespace_packages = None
 
 
+warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
+
+
 class PEP440Warning(RuntimeWarning):
     """
     Used when there is an issue with a version or specifier not complying with
@@ -914,9 +923,7 @@ class WorkingSet:
         list(map(shadow_set.add, self))
 
         for project_name in plugin_projects:
-
             for dist in plugin_env[project_name]:
-
                 req = [dist.as_requirement()]
 
                 try:
@@ -1822,7 +1829,6 @@ class ZipProvider(EggProvider):
 
     # FIXME: 'ZipProvider._extract_resource' is too complex (12)
     def _extract_resource(self, manager, zip_path):  # noqa: C901
-
         if zip_path in self._index():
             for name in self._index()[zip_path]:
                 last = self._extract_resource(manager, os.path.join(zip_path, name))
@@ -1836,7 +1842,6 @@ class ZipProvider(EggProvider):
                 '"os.rename" and "os.unlink" are not supported ' 'on this platform'
             )
         try:
-
             real_path = manager.get_cache_path(self.egg_name, self._parts(zip_path))
 
             if self._is_current(real_path, zip_path):
index 1a651f5575acd158f41b4ae8e6e4969b356c8e8d..016f1181a703ced0ca6565c1139316993f0c2127 100644 (file)
@@ -86,3 +86,6 @@ filterwarnings=
 
        # Avoid errors when testing pkg_resources.declare_namespace
        ignore:.*pkg_resources\.declare_namespace.*:DeprecationWarning
+
+       # suppress known deprecation
+       ignore:pkg_resources is deprecated:DeprecationWarning
index 0fbd809db0c2d9b5b2ccdde112dfd7f874a982cc..947f627b400756022f78c35bc5787a5670c1787a 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = setuptools
-version = 67.4.0
+version = 67.5.0
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
 description = Easily download, build, install, upgrade, and uninstall Python packages
index 7ddbc780fb217796c59b2a8f359ad0071e281ca0..112cdf4b288fe102c2d4432ce1f6cf2b34468fd8 100644 (file)
@@ -6,7 +6,6 @@ import contextlib
 import site
 import io
 
-import pkg_resources
 from filelock import FileLock
 
 
@@ -28,11 +27,7 @@ def environment(**replacements):
     In a context, patch the environment with replacements. Pass None values
     to clear the values.
     """
-    saved = dict(
-        (key, os.environ[key])
-        for key in replacements
-        if key in os.environ
-    )
+    saved = dict((key, os.environ[key]) for key in replacements if key in os.environ)
 
     # remove values that are null
     remove = (key for (key, value) in replacements.items() if value is None)
@@ -81,6 +76,8 @@ def save_user_site_setting():
 
 @contextlib.contextmanager
 def save_pkg_resources_state():
+    import pkg_resources
+
     pr_state = pkg_resources.__getstate__()
     # also save sys.path
     sys_path = sys.path[:]