[bumpversion]
-current_version = 67.4.0
+current_version = 67.5.0
commit = True
tag = True
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`
+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
-------
# 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']
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
"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
]
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.
--------
.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
_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
list(map(shadow_set.add, self))
for project_name in plugin_projects:
-
for dist in plugin_env[project_name]:
-
req = [dist.as_requirement()]
try:
# 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))
'"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):
# Avoid errors when testing pkg_resources.declare_namespace
ignore:.*pkg_resources\.declare_namespace.*:DeprecationWarning
+
+ # suppress known deprecation
+ ignore:pkg_resources is deprecated:DeprecationWarning
[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
import site
import io
-import pkg_resources
from filelock import FileLock
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)
@contextlib.contextmanager
def save_pkg_resources_state():
+ import pkg_resources
+
pr_state = pkg_resources.__getstate__()
# also save sys.path
sys_path = sys.path[:]