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

fix: validate entries in nox.config, too, using attrs #880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Oct 29, 2024

This is a followup to #871. It also reduces the need for #872, as I think it makes it harder or impossible to incorrectly set this via normal means.

Attrs is a well respected, zero dependency, small library by a CPython core dev, but it is an extra dependency. If we did adopt it, though, I would start moving over a few other things, which could improve our internal typing too.

Incomplete list for "NoxCmdOptions":
class NoxCmdOptions(NoxOptions):
    version: bool
    list_sessions: bool
    json: bool
    posargs: list[str]
    add_timestamp: bool
    no_venv: bool
    R: bool
    noxfile: str
    envdir: None | str
    extra_pythons: list[str]
    force_pythons: list[str]
    install_only: bool
    no_install: bool
    report: None | str
    no_reuse_existing_virtualenvs: bool  # backcompat
    non_interactive: bool
    nocolor: bool
    forcecolor: bool
    color: bool
    invoked_from: str

@henryiii henryiii changed the title fix: validate entries in nox.config, too fix: validate entries in nox.config, too, using attrs Oct 29, 2024
Copy link
Collaborator

@DiddiLeija DiddiLeija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a very handy fix to me! However I'd like to see what other mantainers think of adding a dependency before giving the approval :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants