Skip to content

Commit d30aaa5

Browse files
committed
Update test deps (#4045)
2 parents f4dd704 + 6981c04 commit d30aaa5

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

newsfragments/4045.misc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update test dependency on ``build==1.0.3`` and
2+
add fallback for ``packaging==23.1`` (regarding ``Metadata`` validation).

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ testing-integration =
8787
wheel
8888
jaraco.path>=3.2.0
8989
jaraco.envs>=2.2
90-
build[virtualenv]
90+
build[virtualenv]>=1.0.3
9191
filelock>=3.4.0
92-
packaging
92+
packaging>=23.1 # TODO: update once packaging 23.2 is available
9393

9494
docs =
9595
# upstream

setuptools/tests/_packaging_compat.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from packaging import __version__ as packaging_version
2+
3+
if tuple(packaging_version.split(".")) >= ("23", "2"):
4+
from packaging.metadata import Metadata
5+
else:
6+
# Just pretend it exists while waiting for release...
7+
from unittest.mock import MagicMock
8+
9+
Metadata = MagicMock()

setuptools/tests/config/test_apply_pyprojecttoml.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
import pytest
1515
from ini2toml.api import Translator
16-
from packaging.metadata import Metadata
16+
17+
# TODO: replace with `from packaging.metadata import Metadata` in future versions
18+
from .._packaging_compat import Metadata
1719

1820
import setuptools # noqa ensure monkey patch to metadata
1921
from setuptools.dist import Distribution

setuptools/tests/test_core_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
import pytest
77

8-
from packaging.metadata import Metadata
8+
# TODO: replace with `from packaging.metadata import Metadata` in future versions:
9+
from ._packaging_compat import Metadata
910

1011
from setuptools import sic, _reqs
1112
from setuptools.dist import Distribution

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[testenv]
22
deps =
33
# Ideally all the dependencies should be set as "extras"
4-
build[virtualenv] @ git+https://github.com/pypa/build@59c1f87
5-
# ^-- pypa/build#630, use dev version while we wait for the new release
64
packaging @ git+https://github.com/pypa/packaging@7e68d82
75
# ^-- use dev version while we wait for the new release
86
setenv =

0 commit comments

Comments
 (0)