diff --git a/newsfragments/4231.misc.rst b/newsfragments/4231.misc.rst new file mode 100644 index 0000000000..87b9a05c31 --- /dev/null +++ b/newsfragments/4231.misc.rst @@ -0,0 +1 @@ +Bump ``packaging`` to version 23.2 in tests -- by :user:`Avasam` diff --git a/setup.cfg b/setup.cfg index a42439145e..283ceabf3e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -59,6 +59,7 @@ testing = virtualenv>=13.0.0 wheel pip>=19.1 # For proper file:// URLs support. + packaging>=23.2 jaraco.envs>=2.2 pytest-xdist jaraco.path>=3.2.0 @@ -85,7 +86,7 @@ testing-integration = jaraco.envs>=2.2 build[virtualenv]>=1.0.3 filelock>=3.4.0 - packaging>=23.1 # TODO: update once packaging 23.2 is available + packaging>=23.2 docs = # upstream diff --git a/setuptools/tests/_packaging_compat.py b/setuptools/tests/_packaging_compat.py deleted file mode 100644 index 5bdcc554d5..0000000000 --- a/setuptools/tests/_packaging_compat.py +++ /dev/null @@ -1,9 +0,0 @@ -from packaging import __version__ as packaging_version - -if tuple(packaging_version.split(".")) >= ("23", "2"): - from packaging.metadata import Metadata -else: - # Just pretend it exists while waiting for release... - from unittest.mock import MagicMock - - Metadata = MagicMock() diff --git a/setuptools/tests/config/test_apply_pyprojecttoml.py b/setuptools/tests/config/test_apply_pyprojecttoml.py index cffc779b94..e63a89b0b4 100644 --- a/setuptools/tests/config/test_apply_pyprojecttoml.py +++ b/setuptools/tests/config/test_apply_pyprojecttoml.py @@ -15,8 +15,7 @@ import pytest from ini2toml.api import Translator -# TODO: replace with `from packaging.metadata import Metadata` in future versions -from .._packaging_compat import Metadata +from packaging.metadata import Metadata import setuptools # noqa ensure monkey patch to metadata from setuptools.dist import Distribution diff --git a/setuptools/tests/test_core_metadata.py b/setuptools/tests/test_core_metadata.py index 4857093206..68002cc51b 100644 --- a/setuptools/tests/test_core_metadata.py +++ b/setuptools/tests/test_core_metadata.py @@ -5,8 +5,7 @@ import pytest -# TODO: replace with `from packaging.metadata import Metadata` in future versions: -from ._packaging_compat import Metadata +from packaging.metadata import Metadata from setuptools import sic, _reqs from setuptools.dist import Distribution @@ -312,7 +311,7 @@ def test_parity_with_metadata_from_pypa_wheel(tmp_path): # Example with complex requirement definition python_requires=">=3.8", install_requires=""" - packaging==23.0 + packaging==23.2 ordered-set==3.1.1 more-itertools==8.8.0; extra == "other" jaraco.text==3.7.0 diff --git a/tox.ini b/tox.ini index c4f10cd667..2cbff92490 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,6 @@ description = perform primary checks (tests, style, types, coverage) deps = # Ideally all the dependencies should be set as "extras" - packaging @ git+https://github.com/pypa/packaging@7e68d82 - # ^-- use dev version while we wait for the new release setenv = PYTHONWARNDEFAULTENCODING = 1 SETUPTOOLS_ENFORCE_DEPRECATION = {env:SETUPTOOLS_ENFORCE_DEPRECATION:0}