tox-dev / pyproject-api

API to interact with the python pyproject.toml based projects
https://pyproject-api.readthedocs.io/en/latest/?badge=latest
MIT License
24 stars 11 forks source link

1.5.4: pytest is failing #96

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pyproject-api-1.5.4-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pyproject-api-1.5.4-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.2.0 rootdir: /home/tkloczko/rpmbuild/BUILD/pyproject-api-1.5.4 plugins: mock-3.11.1 collected 56 items tests/test_backend.py ........ [ 14%] tests/test_frontend.py .......................... [ 60%] tests/test_frontend_setuptools.py ..F....... [ 78%] tests/test_main.py ....... [ 91%] tests/test_util.py .... [ 98%] tests/test_version.py . [100%] ========================================================================================= FAILURES ========================================================================================== _____________________________________________________________________ test_setuptools_prepare_metadata_for_build_wheel ______________________________________________________________________ frontend_setuptools = tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-4/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) 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)'...equests (>2)'] == ['magic >3', 'requests >2'] E At index 0 diff: 'magic (>3)' != 'magic >3' E Use -v to get more diff tests/test_frontend_setuptools.py:78: AssertionError ================================================================================== short test summary info ================================================================================== FAILED tests/test_frontend_setuptools.py::test_setuptools_prepare_metadata_for_build_wheel - AssertionError: assert ['magic (>3)'...equests (>2)'] == ['magic >3', 'requests >2'] =============================================================================== 1 failed, 55 passed in 5.01s ================================================================================ ```

Here is list of installed modules in build env

```console Package Version ----------------------------- -------- alabaster 0.7.13 Babel 2.12.1 build 0.10.0 charset-normalizer 3.2.0 distlib 0.3.7 distro 1.8.0 docutils 0.20.1 editables 0.5 exceptiongroup 1.1.1 filelock 3.12.2 gpg 1.20.0 hatch-vcs 0.3.0 hatchling 1.18.0 idna 3.4 imagesize 1.4.1 importlib-metadata 6.8.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.2 libcomps 0.1.19 MarkupSafe 2.1.3 packaging 23.1 pathspec 0.11.2 platformdirs 3.10.0 pluggy 1.2.0 Pygments 2.16.0 pyproject_hooks 1.0.0 pytest 7.4.0 pytest-mock 3.11.1 python-dateutil 2.8.2 pytz 2023.2 requests 2.31.0 setuptools 68.0.0 setuptools-scm 7.1.0 six 1.16.0 snowballstemmer 2.2.0 Sphinx 7.0.1 sphinx_autodoc_typehints 1.22.0 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.3 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 tomli 2.0.1 trove-classifiers 2023.8.9 typing_extensions 4.7.1 urllib3 1.26.15 virtualenv 20.24.3 wheel 0.40.0 zipp 3.16.2 ```
tjni commented 1 year ago

https://github.com/tox-dev/pyproject-api/commit/91cb132eb6cbe5e4c08773b4302ddc80baaedca1 updated the minimum wheel version to 0.41.1 and indeed it's necessary because of https://github.com/pypa/wheel/pull/552

gaborbernat commented 1 year ago

Sorry, the latest version of that project is required. It's the only version we test with within the CI and as such anything else is the best effort at best.

kloczek commented 1 year ago

Tested and indeed after upgrade wheel everything is OK. Thank you 👍