Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.4: pytest is failing #96

Closed
kloczek opened this issue Aug 17, 2023 · 3 comments
Closed

1.5.4: pytest is failing #96

kloczek opened this issue Aug 17, 2023 · 3 comments

Comments

@kloczek
Copy link

kloczek commented Aug 17, 2023

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.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix> using 'installer` module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")

Here is pytest output:

+ 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 = <pyproject_api._via_fresh_subprocess.SubprocessFrontend object at 0x7fbf79f4f2b0>
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

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
Copy link

tjni commented Aug 17, 2023

91cb132 updated the minimum wheel version to 0.41.1 and indeed it's necessary because of pypa/wheel#552

@gaborbernat
Copy link
Member

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.

@gaborbernat gaborbernat closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2023
@kloczek
Copy link
Author

kloczek commented Aug 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants