jaraco / jaraco.packaging

MIT License
4 stars 4 forks source link

tests not working with pytest in 8.2.1 #5

Closed a16bitsysop closed 2 years ago

a16bitsysop commented 3 years ago

In 8.2.0 when tests are run I get:

================================================================================= test session starts =================================================================================
platform linux -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/d/aports/testing/py3-jaraco-packaging/src/jaraco.packaging-8.2.0, configfile: pytest.ini
collected 2 items                                                                                                                                                                     

jaraco/packaging/depends.py .                                                                                                                                                   [ 50%]
jaraco/packaging/info.py .                                                                                                                                                      [100%]

================================================================================== warnings summary ===================================================================================
../../../../../../../usr/lib/python3.8/site-packages/packaging/version.py:127: 148 warnings
  /usr/lib/python3.8/site-packages/packaging/version.py:127: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================================================================== 2 passed, 148 warnings in 2.27s ===========================================================================

with 8.2.1 when tests are run I get:

================================================================================= test session starts =================================================================================
platform linux -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/d/aports/testing/py3-jaraco-packaging/src/jaraco.packaging-8.2.1, configfile: pytest.ini
collected 0 items / 2 errors                                                                                                                                                          

======================================================================================= ERRORS ========================================================================================
____________________________________________________________________ ERROR collecting jaraco/packaging/depends.py _____________________________________________________________________
jaraco/packaging/depends.py:10: in <module>
    import setuptools
/usr/lib/python3.8/site-packages/setuptools/__init__.py:16: in <module>
    import setuptools.version
/usr/lib/python3.8/site-packages/setuptools/version.py:1: in <module>
    import pkg_resources
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:76: in <module>
    __import__('packaging.version')
E   ModuleNotFoundError: No module named 'packaging.version'
______________________________________________________________________ ERROR collecting jaraco/packaging/info.py ______________________________________________________________________
jaraco/packaging/info.py:4: in <module>
    import setuptools
/usr/lib/python3.8/site-packages/setuptools/__init__.py:16: in <module>
    import setuptools.version
/usr/lib/python3.8/site-packages/setuptools/version.py:1: in <module>
    import pkg_resources
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:76: in <module>
    __import__('packaging.version')
E   ModuleNotFoundError: No module named 'packaging.version'
=============================================================================== short test summary info ===============================================================================
ERROR jaraco/packaging/depends.py - ModuleNotFoundError: No module named 'packaging.version'
ERROR jaraco/packaging/info.py - ModuleNotFoundError: No module named 'packaging.version'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================== 2 errors in 0.94s ==================================================================================

test dependencies I have are only pytest, build dependencies are setuptools and setuptools-scm

I tried changing build from python setup.py build to python -m build, but the error was the same.

The errors are the same if test command is pytest or python -m pytest

a16bitsysop commented 3 years ago

tests pass if i cp /usr/lib/python3.8/site-packages/jaraco/__init__.py jaraco/ before python3 setup.py build

mgorny commented 2 years ago

Ping.

jaraco commented 2 years ago

You'll notice that the errors you get don't occur in this project's CI but also that the errors don't even include this project in the traceback except where 'import setuptools' is called, so the issue lies with how the environment has installed setuptools. You'll want to figure out why 'import setuptools' fails in your environment.

For this project, however, the usefulness of setuptools commands is going away and the latest version removes that functionality.