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

10.2.1: pytest fails in jaraco/packaging/print-metadata.py::packaging.print-metadata.main units #19

Open
kloczek opened this issue Jun 21, 2024 · 3 comments

Comments

@kloczek
Copy link

kloczek commented Jun 21, 2024

10.2.0 was OK.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jaraco-packaging-10.2.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jaraco-packaging-10.2.1-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.1
configfile: pytest.ini
plugins: mypy-0.10.3
collected 5 items

jaraco/packaging/metadata.py ..                                          [ 40%]
jaraco/packaging/print-metadata.py F                                     [ 60%]
jaraco/packaging/sphinx.py ..                                            [100%]

=================================== FAILURES ===================================
___________________ [doctest] packaging.print-metadata.main ____________________
005
006     >>> main()
UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'packaging.version'")
Traceback (most recent call last):
  File "/usr/lib64/python3.10/doctest.py", line 1350, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest packaging.print-metadata.main[0]>", line 1, in <module>
  File "/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.1/jaraco/packaging/print-metadata.py", line 9, in main
    md = metadata.load('.')
  File "/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.1/jaraco/packaging/metadata.py", line 15, in load
    return util.project_wheel_metadata(source_dir, isolated, **kwargs)
  File "/usr/lib/python3.10/site-packages/build/util.py", line 42, in project_wheel_metadata
    with DefaultIsolatedEnv() as env:
  File "/usr/lib/python3.10/site-packages/build/env.py", line 90, in __enter__
    self._env_backend = _PipBackend()
  File "/usr/lib/python3.10/site-packages/build/env.py", line 153, in __init__
    self._create_with_virtualenv = not self._has_valid_outer_pip and self._has_virtualenv
  File "/usr/lib64/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/usr/lib/python3.10/site-packages/build/env.py", line 162, in _has_valid_outer_pip
    return _has_dependency('pip', '22.3')
  File "/usr/lib/python3.10/site-packages/build/env.py", line 46, in _has_dependency
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging.version'
/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.1/jaraco/packaging/print-metadata.py:6: UnexpectedException
=============================== warnings summary ===============================
jaraco/packaging/sphinx.py::packaging.sphinx._load_metadata_from_wheel
  /home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.1/jaraco/packaging/sphinx.py:100: DeprecationWarning: JARACO_PACKAGING_SPHINX_WHEEL is deprecated; use BUILD_ENVIRONMENT=current instead
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED jaraco/packaging/print-metadata.py::packaging.print-metadata.main
==================== 1 failed, 4 passed, 1 warning in 0.77s ====================
@kloczek
Copy link
Author

kloczek commented Jun 21, 2024

Looks like pep517 build did not even packaged packaging.version

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
running egg_info
creating jaraco.packaging.egg-info
writing jaraco.packaging.egg-info/PKG-INFO
writing dependency_links to jaraco.packaging.egg-info/dependency_links.txt
writing requirements to jaraco.packaging.egg-info/requires.txt
writing top-level names to jaraco.packaging.egg-info/top_level.txt
writing manifest file 'jaraco.packaging.egg-info/SOURCES.txt'
reading manifest file 'jaraco.packaging.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'jaraco.packaging.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/jaraco
creating build/lib/jaraco/packaging
copying jaraco/packaging/__init__.py -> build/lib/jaraco/packaging
copying jaraco/packaging/make-tree.py -> build/lib/jaraco/packaging
copying jaraco/packaging/metadata.py -> build/lib/jaraco/packaging
copying jaraco/packaging/print-metadata.py -> build/lib/jaraco/packaging
copying jaraco/packaging/sphinx.py -> build/lib/jaraco/packaging
running egg_info
writing jaraco.packaging.egg-info/PKG-INFO
writing dependency_links to jaraco.packaging.egg-info/dependency_links.txt
writing requirements to jaraco.packaging.egg-info/requires.txt
writing top-level names to jaraco.packaging.egg-info/top_level.txt
reading manifest file 'jaraco.packaging.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'jaraco.packaging.egg-info/SOURCES.txt'
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/jaraco
creating build/bdist.linux-x86_64/wheel/jaraco/packaging
copying build/lib/jaraco/packaging/__init__.py -> build/bdist.linux-x86_64/wheel/jaraco/packaging
copying build/lib/jaraco/packaging/make-tree.py -> build/bdist.linux-x86_64/wheel/jaraco/packaging
copying build/lib/jaraco/packaging/metadata.py -> build/bdist.linux-x86_64/wheel/jaraco/packaging
copying build/lib/jaraco/packaging/print-metadata.py -> build/bdist.linux-x86_64/wheel/jaraco/packaging
copying build/lib/jaraco/packaging/sphinx.py -> build/bdist.linux-x86_64/wheel/jaraco/packaging
running install_egg_info
Copying jaraco.packaging.egg-info to build/bdist.linux-x86_64/wheel/jaraco.packaging-10.2.1-py3.10.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/jaraco.packaging-10.2.1.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.1/dist/.tmp-l6px35b1/jaraco.packaging-10.2.1-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'jaraco/packaging/__init__.py'
adding 'jaraco/packaging/make-tree.py'
adding 'jaraco/packaging/metadata.py'
adding 'jaraco/packaging/print-metadata.py'
adding 'jaraco/packaging/sphinx.py'
adding 'jaraco.packaging-10.2.1.dist-info/LICENSE'
adding 'jaraco.packaging-10.2.1.dist-info/METADATA'
adding 'jaraco.packaging-10.2.1.dist-info/WHEEL'
adding 'jaraco.packaging-10.2.1.dist-info/top_level.txt'
adding 'jaraco.packaging-10.2.1.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built jaraco.packaging-10.2.1-py3-none-any.whl

@kloczek
Copy link
Author

kloczek commented Jun 21, 2024

With 10.2.2 it is even worse ..

Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jaraco-packaging-10.2.2-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jaraco-packaging-10.2.2-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2
configfile: pytest.ini
plugins: mypy-0.10.3
collected 6 items

jaraco/packaging/metadata.py ..F                                         [ 50%]
jaraco/packaging/print-metadata.py F                                     [ 66%]
jaraco/packaging/sphinx.py ..                                            [100%]

=================================== FAILURES ===================================
__________________ [doctest] packaging.metadata.hunt_down_url __________________
019
020     Given project metadata, figure out what the package URL is.
021
022     >>> hunt_down_url(load('.'))
UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'packaging.version'")
Traceback (most recent call last):
  File "/usr/lib64/python3.10/doctest.py", line 1350, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest packaging.metadata.hunt_down_url[0]>", line 1, in <module>
  File "/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2/jaraco/packaging/metadata.py", line 15, in load
    return util.project_wheel_metadata(source_dir, isolated, **kwargs)
  File "/usr/lib/python3.10/site-packages/build/util.py", line 42, in project_wheel_metadata
    with DefaultIsolatedEnv() as env:
  File "/usr/lib/python3.10/site-packages/build/env.py", line 90, in __enter__
    self._env_backend = _PipBackend()
  File "/usr/lib/python3.10/site-packages/build/env.py", line 153, in __init__
    self._create_with_virtualenv = not self._has_valid_outer_pip and self._has_virtualenv
  File "/usr/lib64/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/usr/lib/python3.10/site-packages/build/env.py", line 162, in _has_valid_outer_pip
    return _has_dependency('pip', '22.3')
  File "/usr/lib/python3.10/site-packages/build/env.py", line 46, in _has_dependency
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging.version'
/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2/jaraco/packaging/metadata.py:22: UnexpectedException
___________________ [doctest] packaging.print-metadata.main ____________________
005
006     >>> main()
UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'packaging.version'")
Traceback (most recent call last):
  File "/usr/lib64/python3.10/doctest.py", line 1350, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest packaging.print-metadata.main[0]>", line 1, in <module>
  File "/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2/jaraco/packaging/print-metadata.py", line 9, in main
    md = metadata.load('.')
  File "/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2/jaraco/packaging/metadata.py", line 15, in load
    return util.project_wheel_metadata(source_dir, isolated, **kwargs)
  File "/usr/lib/python3.10/site-packages/build/util.py", line 42, in project_wheel_metadata
    with DefaultIsolatedEnv() as env:
  File "/usr/lib/python3.10/site-packages/build/env.py", line 90, in __enter__
    self._env_backend = _PipBackend()
  File "/usr/lib/python3.10/site-packages/build/env.py", line 153, in __init__
    self._create_with_virtualenv = not self._has_valid_outer_pip and self._has_virtualenv
  File "/usr/lib64/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/usr/lib/python3.10/site-packages/build/env.py", line 162, in _has_valid_outer_pip
    return _has_dependency('pip', '22.3')
  File "/usr/lib/python3.10/site-packages/build/env.py", line 46, in _has_dependency
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging.version'
/home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2/jaraco/packaging/print-metadata.py:6: UnexpectedException
=============================== warnings summary ===============================
jaraco/packaging/sphinx.py::packaging.sphinx._load_metadata_from_wheel
  /home/tkloczko/rpmbuild/BUILD/jaraco.packaging-10.2.2/jaraco/packaging/sphinx.py:100: DeprecationWarning: JARACO_PACKAGING_SPHINX_WHEEL is deprecated; use BUILD_ENVIRONMENT=current instead
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED jaraco/packaging/metadata.py::packaging.metadata.hunt_down_url
FAILED jaraco/packaging/print-metadata.py::packaging.print-metadata.main
==================== 2 failed, 4 passed, 1 warning in 0.70s ====================

@kloczek
Copy link
Author

kloczek commented Sep 27, 2024

Just tested 10.2.3 and pytest still fails.

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

1 participant