Repository navigation
Tests in source distribution fail due to missing conftest module #117
Copy link
Copy link
Closed
Description
=============================================================== ERRORS ================================================================
_____________________________________________ ERROR collecting tests/test_ruff_format.py ______________________________________________
ImportError while importing test module '/tmp/portage/dev-python/python-lsp-ruff-2.3.2/work/python_lsp_ruff-2.3.2/tests/test_ruff_format.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/site-packages/_pytest/python.py:508: in importtestmodule
mod = import_path(
/usr/lib/python3.12/site-packages/_pytest/pathlib.py:596: in import_path
importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
/usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:188: in exec_module
exec(co, module.__dict__)
tests/test_ruff_format.py:7: in <module>
from conftest import temp_document
E ModuleNotFoundError: No module named 'conftest'
______________________________________________ ERROR collecting tests/test_ruff_lint.py _______________________________________________
ImportError while importing test module '/tmp/portage/dev-python/python-lsp-ruff-2.3.2/work/python_lsp_ruff-2.3.2/tests/test_ruff_lint.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/site-packages/_pytest/python.py:508: in importtestmodule
mod = import_path(
/usr/lib/python3.12/site-packages/_pytest/pathlib.py:596: in import_path
importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
/usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:188: in exec_module
exec(co, module.__dict__)
tests/test_ruff_lint.py:12: in <module>
from conftest import temp_document
E ModuleNotFoundError: No module named 'conftest'
--------------- generated xml file: /tmp/portage/dev-python/python-lsp-ruff-2.3.2/temp/pytest-xml/python3.12-GjMYzh.xml ---------------
======================================================= short test summary info =======================================================
ERROR tests/test_ruff_format.py
ERROR tests/test_ruff_lint.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================== 2 errors in 0.64s ==========================================================```And apparently there are significant differences between the source distribution and v2.3.2 git tag (and main, so to say).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
jhossbach commentedon Aug 16, 2026
Hi, I am not sure how to reproduce this error, can you tell me what source distribution you are referring to?
Also can you walk me through your steps to reproduce the issue, and maybe a pip freeze of your packages? It looks like you are using the system-installed pytest, what version is that?
mgorny commentedon Aug 16, 2026
The one here: https://pypi.org/project/python-lsp-ruff/#files
(or just compare the files after unpacking to the git repository)
jhossbach commentedon Aug 17, 2026
Shoot, this is on me, I accidentally built and published a version with a cherry-picked commit from the
fix/virtual_documents_dirbranch.Let me create a CI action for publishing from now on...
Will yank the current version and add a minor version increment.
chore: add publish workflow (#117)
jhossbach commentedon Aug 17, 2026
Thanks for letting me know @mgorny :)
mgorny commentedon Aug 17, 2026
Thanks. The new version looks good.