Skip to content
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

Use pytest config in pyproject.toml in CI #7555

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lagru
Copy link
Member

@lagru lagru commented Sep 27, 2024

Description

Closes #7554.

This should be safe, as the pytest documentation states that

rootdir is NOT used to modify sys.path/PYTHONPATH

So while the --config-file option affects the rootdir, it's not adding that directory to the PYTHONPATH where it could accidentally overwrite the installed package.

Checklist

Release note

For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.

...

@lagru lagru added the 🤖 type: Infrastructure CI, packaging, tools and automation label Sep 27, 2024
This should be safe, as the pytest documentation [1] states that
"rootdir is NOT used to modify sys.path/PYTHONPATH". So while the
`--config-file` option affects the `rootdir`, it's not adding that
directory to the PYTHONPATH where it could accidentally overwrite the
installed package. This solution is somewhat unsatisfying. Personally,
I think a better approach would be to switch to the src-layout.

[1] https://docs.pytest.org/en/7.1.x/reference/customize.html?highlight=rootdir#initialization-determining-rootdir-and-configfile
@lagru lagru changed the title Debug pytest config not being picked up in tests.yml workflow Use pytest config in pyroject.toml in CI Sep 27, 2024
@lagru lagru marked this pull request as ready for review October 4, 2024 13:00
@stefanv stefanv changed the title Use pytest config in pyroject.toml in CI Use pytest config in pyproject.toml in CI Dec 17, 2024
@lagru
Copy link
Member Author

lagru commented Dec 17, 2024

During the meeting @stefanv suggested to use a different approach and just not step out of the project directory. It was suggested that that may be outdated behavior from a long time ago. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 type: Infrastructure CI, packaging, tools and automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pytest config in pyproject.toml isn't used in CI
1 participant