1.7.2: `test_setuptools_prepare_metadata_for_build_wheel` fails
_______________ test_setuptools_prepare_metadata_for_build_wheel _______________
frontend_setuptools = <pyproject_api._via_fresh_subprocess.SubprocessFrontend object at 0x7fffad561a30>
tmp_path = PosixPath('/tmp/pytest-of-marcel/pytest-21/test_setuptools_prepare_metada0')
def test_setuptools_prepare_metadata_for_build_wheel(frontend_setuptools: SubprocessFrontend, tmp_path: Path) -> None:
meta = tmp_path / "meta"
result = frontend_setuptools.prepare_metadata_for_build_wheel(metadata_directory=meta)
assert result is not None
dist = Distribution.at(str(result.metadata))
assert list(dist.entry_points) == [EntryPoint(name="demo_exe", value="demo:a", group="console_scripts")]
assert dist.version == "1.0"
assert dist.metadata["Name"] == "demo"
values = [v for k, v in dist.metadata.items() if k == "Requires-Dist"] # type: ignore[attr-defined]
# ignore because "PackageMetadata" has no attribute "items"
> assert sorted(values) == ["magic >3", "requests >2"]
E AssertionError: assert ['magic>3', 'requests>2'] == ['magic >3', 'requests >2']
E
E At index 0 diff: 'magic>3' != 'magic >3'
E
E Full diff:
E [
E - 'magic >3',
E ? -
E + 'magic>3',
E - 'requests >2',
E ? -
E + 'requests>2',
E ]
tests/test_frontend_setuptools.py:76: AssertionError
To reproduce:
- download 1.7.2 sdist
- unpack it
- run
tox -e py39
Came across this while updating the Debian package too. It's broken by a newer version of setuptools (or at least in the Debian package of it).
Good: 70.3.0 Bad: 72.2.0, 73.0.1, 74.1.2
Also ran into this on Arch Linux and we have a somewhat ancient setuptools (69.5.1).
I will disable this test as I guess this isn't really protect against what it's supposed to protect against :thinking:
assuming https://github.com/tox-dev/pyproject-api/commit/81e9d2214d4904afefac2e7decad8d5c5cd95b45 was supposed to address this issue, the fix doesn't seem correct - we've just hit an issue with this on Alpine, and we run tests with Python 3.12:
expected = ["magic>3", "requests>2"] if sys.version_info[0:2] > (3, 8) else ["magic >3", "requests >2"]
> assert sorted(values) == expected
E AssertionError: assert ['magic >3', 'requests >2'] == ['magic>3', 'requests>2']
E
E At index 0 diff: 'magic >3' != 'magic>3'
E Use -v to get more diff
tests/test_frontend_setuptools.py:78: AssertionError