Open mschubert opened 3 months ago
Thanks for reporting the issue! @mr-c Maybe you have suggestions from the Debian packaging?
The issue here seems to be that -m gpep517
(at least in Gentoo ebuilds) does not allow in-source builds. The pytest.ini
and test_data
are in the sources, while the compiled (or installed) package is in a separate directory.
I could get most tests to run by linking pytest.ini
and test_data
into the built directory and calling pytest
from there.
Now, only the following two fail:
lib.linux-x86_64-cpython-312/bx/binned_array_tests.py::test_file_lzo
lib.linux-x86_64-cpython-312/bx/binned_array_tests.py::test_binned_array_writer
both with:
compress = comp_types[comp_type][0]
E KeyError: 'lzo'
I could get most tests to run by linking
pytest.ini
andtest_data
into the built directory and callingpytest
from there.
That's good progress, thanks for your work on that!
Now, only the following two fail:
lib.linux-x86_64-cpython-312/bx/binned_array_tests.py::test_file_lzo lib.linux-x86_64-cpython-312/bx/binned_array_tests.py::test_binned_array_writer
both with:
compress = comp_types[comp_type][0] E KeyError: 'lzo'
That's likely due to missing python-lzo, which is not strictly required by bx-python but it's need for these tests to pass, see https://github.com/bxlab/bx-python/blob/main/tox.ini#L16
Oh yes, that makes sense. Thank you!
I edited the title for the PEP517 tests, please feel free to leave open or close as you prefer.
@mschubert Sorry for late reply here, if there's anything that we can do here that would make your life easier let us know!
When trying to run the tests of a locally built wheel, I run into errors in the collection phase. The steps are, roughly:
The relevant sections are:
This always worked fine with other packages, so I'm not sure what's going wrong here.
Detailed log here (including package versions)
``` 2024-07-16 09:58:34,058 gpep517 INFO The backend produced /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/wheel/bx_python-0.12.0-cp312-cp312-linux_x86_64.whl /my_dir/* Installing bx_python-0.12.0-cp312-cp312-linux_x86_64.whl to /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/install python3.12 -m gpep517 install-wheel --destdir=/my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/install --interpreter=/my_dir/usr/bin/python3.12 --prefix=/my_dir/usr --optimize=all /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/wheel/bx_python-0.12.0-cp312-cp312-linux_x86_64.whl 2024-07-16 09:58:35,223 gpep517 INFO Installing /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/wheel/bx_python-0.12.0-cp312-cp312-linux_x86_64.whl into /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/install 2024-07-16 09:58:36,175 gpep517 INFO Installation complete >>> Source compiled. >>> Test phase: sci-biology/bx-python-0.12.0 /my_dir/* python3_12: running distutils-r1_run_phase python_test python3.12 -m pytest -vv -ra -l -Wdefault -Werror::pytest.PytestUnhandledCoroutineWarning --color=yes -o console_output_style=count -o tmp_path_retention_count=0 -o tmp_path_retention_policy=failed -p no:cov -p no:flake8 -p no:flakes -p no:pylint -p no:markdown -p no:sugar -p no:xvfb -p no:pytest-describe -p no:plus -p no:tavern -p no:salt-factories ============================= test session starts ============================== platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0 -- /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0-python3_12/install/my_dir/usr/bin/python3.12 cachedir: .pytest_cache hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0/.hypothesis/examples')) rootdir: /my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0 configfile: pytest.ini testpaths: lib, script_tests/ plugins: asyncio-0.23.7, hypothesis-6.103.2, pkgcore-0.12.27, typeguard-4.3.0 asyncio: mode=Mode.STRICT collecting ... collected 62 items / 18 errors ==================================== ERRORS ==================================== __________________ ERROR collecting lib/bx/align/epo_tests.py __________________ ImportError while importing test module '/my_dir/var/tmp/portage/sci-biology/bx-python-0.12.0/work/bx-python-0.12.0/lib/bx/align/epo_tests.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../../../../../usr/lib/python3.12/site-packages/_pytest/python.py:492: in importtestmodule mod = import_path( ../../../../../../../usr/lib/python3.12/site-packages/_pytest/pathlib.py:591: 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)