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

[Feature] Add support for toml #596

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

Conversation

qequ
Copy link

@qequ qequ commented Dec 27, 2023

Fixes #452

Signed-off-by: Alvaro Frias Garay <alvarofriasgaray@gmail.com>
Signed-off-by: Alvaro Frias Garay <alvarofriasgaray@gmail.com>
Signed-off-by: Alvaro Frias Garay <alvarofriasgaray@gmail.com>
@JCHacking
Copy link
Contributor

JCHacking commented Apr 11, 2024

Now in python 3.11 there is a built-in library to interact with toml, it could be applied to avoid installing this dependency.

@sirosen
Copy link
Collaborator

sirosen commented Apr 12, 2024

I haven't been making enough time for nose2 lately, but this PR currently isn't quite in a state that I feel I can merge.
I've needed to take time to offer feedback, since it's close, as far as I'm concerned.

  • it needs to be restricted to pyproject.toml, not any toml file
  • I think we should be using tomli on py<3.11 and stdlib tomllib on 3.11+ -- partly because tomli is what was ported into tomllib
  • ☝️ the dependency on tomli should be conditional on a python_version marker

Those are the main things.

I'm also a little bit concerned in theory that nose2 could be confused and made to crash with certain inputs (namely, TOML-native datetime data, which would manifest as unexpected datetime.datetime objects in the config), but I don't know that the config loading which exists today is sufficiently hardened against these sorts of usages. So I wouldn't worry much about it but it would be nice to check on that, maybe after this or a similar changeset merges.

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.

Support configuring through pyproject.toml
3 participants