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

Support loading config from pyproject.toml #606

Merged
merged 6 commits into from
May 29, 2024
Merged

Conversation

sirosen
Copy link
Collaborator

@sirosen sirosen commented May 8, 2024

This is a continuation of the work started in #596 -- thanks to @qequ for getting this started!

I've made some changes which I believe are important to nose2 supporting the full breadth of use cases, including test matrices which run tests with TOML parsers present and absent in lower python versions.
In general, I think nose2 should avoid addig dependencies outside of the stdlib, since it is a test runner.
There's some room for healthy debate on this, but with the current course of tomli->tomllib, I don't think it's necessary for TOML support to add a hard dependency or an extra.

qequ and others added 6 commits May 29, 2024 14:48
Signed-off-by: Alvaro Frias Garay <[email protected]>
Signed-off-by: Alvaro Frias Garay <[email protected]>
Signed-off-by: Alvaro Frias Garay <[email protected]>
tomli was ported to stdlib tomllib, so it's preferable to use these
implementations for clearer (and more standard/common style)
compatibility across versions.

In order to have the failthrough behavior be clear, with dispatch
onto TOML support controlled via a bool, this is wrapped in a module
which provides failover on import errors per the normal path to
prefer tomllib where available.

'tomli' is not required by nose2, not even on lower python versions,
to ensure that application testing which is sensitive to and
dispatched over the presence/absence of a toml loader is supported.

tox matrix config supports toml-enabled test invocation for the lower
python versions.
This ensures that the tests work when run from the packaged source, as
the pyproject.toml files used as test cases are included.
@sirosen
Copy link
Collaborator Author

sirosen commented May 29, 2024

I finally made a few minutes to look into those CI failures. The cause was pretty simple: missing *.toml from the MANIFEST.in includes. I've rebased + added the relevant tweak.

@sirosen sirosen merged commit 10b3188 into main May 29, 2024
22 checks passed
@sirosen sirosen deleted the support-pyproject.toml branch May 29, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants