The changes to pyproject.toml are needed to allow running the tests on the installed version of the code. The --ignore paths are resolved relative to the current directory before being compared to the test files if they're not already absolute. This works fine when running from the repository root, but pytest would have to be run from site-packages/ to get the same relative file paths and it would try to run the tests of every installed package.
--rootdir . makes pytest collect the tests from the installed package instead of the parent directory of the configuration file.
PR Checklist
[ ] New features are documented, with docstrings and narrative docs
[ ] Adds a test for any bugs fixed. Adds tests for new features.
PR Summary
The changes to pyproject.toml are needed to allow running the tests on the installed version of the code. The
--ignore
paths are resolved relative to the current directory before being compared to the test files if they're not already absolute. This works fine when running from the repository root, but pytest would have to be run fromsite-packages/
to get the same relative file paths and it would try to run the tests of every installed package.--rootdir .
makes pytest collect the tests from the installed package instead of the parent directory of the configuration file.PR Checklist