Skip to content

Commit

Permalink
Update test deps (#4045)
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Sep 11, 2023
2 parents f4dd704 + 6981c04 commit d30aaa5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions newsfragments/4045.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update test dependency on ``build==1.0.3`` and
add fallback for ``packaging==23.1`` (regarding ``Metadata`` validation).
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ testing-integration =
wheel
jaraco.path>=3.2.0
jaraco.envs>=2.2
build[virtualenv]
build[virtualenv]>=1.0.3
filelock>=3.4.0
packaging
packaging>=23.1 # TODO: update once packaging 23.2 is available

docs =
# upstream
Expand Down
9 changes: 9 additions & 0 deletions setuptools/tests/_packaging_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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()
4 changes: 3 additions & 1 deletion setuptools/tests/config/test_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

import pytest
from ini2toml.api import Translator
from packaging.metadata import Metadata

# TODO: replace with `from packaging.metadata import Metadata` in future versions
from .._packaging_compat import Metadata

import setuptools # noqa ensure monkey patch to metadata
from setuptools.dist import Distribution
Expand Down
3 changes: 2 additions & 1 deletion setuptools/tests/test_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import pytest

from packaging.metadata import Metadata
# TODO: replace with `from packaging.metadata import Metadata` in future versions:
from ._packaging_compat import Metadata

from setuptools import sic, _reqs
from setuptools.dist import Distribution
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[testenv]
deps =
# Ideally all the dependencies should be set as "extras"
build[virtualenv] @ git+https://github.com/pypa/build@59c1f87
# ^-- pypa/build#630, use dev version while we wait for the new release
packaging @ git+https://github.com/pypa/packaging@7e68d82
# ^-- use dev version while we wait for the new release
setenv =
Expand Down

0 comments on commit d30aaa5

Please sign in to comment.