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
Tests try to install to system directory #469
Comments
What exactly are you trying to accomplish by packaging it yourself? The 'official' specfile for python-scikit-build on openSUSE leaves out these tests for exactly this reason: %check
# setup.py install, develop, etc default to writing to /usr .
# Tests need enhancing upstream or patching.
%pytest -k 'not (test_install_command or test_develop_command or test_test_command or test_hello_develop)' The tests are not needed for a proper rpm package |
@bnavigator I am trying to get the tests working in the official openSUSE packages so we can catch issues early. We are having a build issue with blosc, for example, and having the tests working can help us figure out where exactly the problem lies. That is why we try to have tests running whenever possible, and when we can't we try to work with upstream to get them working. |
Okay here is how I proposed to fix it in the openSUSE package:
[develop]
prefix=/tmp/fakepythonroot/usr/
[install]
prefix=/tmp/fakepythonroot/usr/
Simply adding a I considered writing a PR for this, but I am struggling how to implement the creation of the fake sitelib. Maybe a module- or session-wide pytest fixture? However, passing the path to the projects would need to be done in code instead of the static |
Can't the tests be modified to use a temporary install root? Even when you're running in a dedicated test root, it gets "tainted" after a single test run since the installed packages are left there. If I diff the contents of
Not only this is a hassle for downstream packagers who need to clean up after the test suite but I can well imagine that this could cause false test results in the future, when someone runs tests more than once. |
I am packaging scikit-build for openSUSE Linux and we are running into issues where the tests try to install to a system purelib directory that the build system doesn't have write access to. It would be helpful if the tests were configured to install to a temporary directory rather than a system directory.
For example
tests/test_hello_cpp.py::test_hello_develop
installs to:The specific tests that are causing this problem are:
The text was updated successfully, but these errors were encountered: