pypa / flit

Simplified packaging of Python modules
https://flit.pypa.io/
BSD 3-Clause "New" or "Revised" License
2.14k stars 130 forks source link

test_upload.py and test_validate.py fail due to missing dependency yaml #643

Closed johanneskastl closed 1 year ago

johanneskastl commented 1 year ago

The flit package on openSUSE fails the checks, as the yaml module cannot be found.

I have not found it mentioned in the requirements, so I guess this just was always there by accident and should be added?

[   30s] ==================================== ERRORS ====================================
[   30s] ____________________ ERROR collecting tests/test_upload.py _____________________
[   30s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/flit-3.8.0/tests/test_upload.py'.
[   30s] Hint: make sure your test modules/packages have valid Python names.
[   30s] Traceback:
[   30s] /usr/lib64/python3.11/importlib/__init__.py:126: in import_module
[   30s]     return _bootstrap._gcd_import(name[level:], package, level)
[   30s] tests/test_upload.py:9: in <module>
[   30s]     import responses
[   30s] /usr/lib/python3.11/site-packages/responses/__init__.py:28: in <module>
[   30s]     import yaml
[   30s] E   ModuleNotFoundError: No module named 'yaml'
[   30s] ___________________ ERROR collecting tests/test_validate.py ____________________
[   30s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/flit-3.8.0/tests/test_validate.py'.
[   30s] Hint: make sure your test modules/packages have valid Python names.
[   30s] Traceback:
[   30s] /usr/lib64/python3.11/importlib/__init__.py:126: in import_module
[   30s]     return _bootstrap._gcd_import(name[level:], package, level)
[   30s] tests/test_validate.py:3: in <module>
[   30s]     import responses
[   30s] /usr/lib/python3.11/site-packages/responses/__init__.py:28: in <module>
[   30s]     import yaml
[   30s] E   ModuleNotFoundError: No module named 'yaml'
takluyver commented 1 year ago

Looking at the traceback, it's the responses package, which is already there in test deps, which imports yaml. Responses already has a dependency on PyYAML:

https://github.com/getsentry/responses/blob/071306524af1b4ee1797c45a46525274d271a9b6/setup.py#L22

So it sounds like OpenSUSE's packaging of responses might be missing a dependency.

johanneskastl commented 1 year ago

Ah, sorry, I missed that. I'll have a look at the response package dependencies...