Skip to content

fix: support scripts with custom names - #1007

Merged
henryiii merged 1 commit into
wntrblm:mainfrom
henryiii:henryiii/fix/namedscript
Oct 13, 2025
Merged

henryiii merged 1 commit into
wntrblm:mainfrom
henryiii:henryiii/fix/namedscript

Conversation

@henryiii

@henryiii henryiii commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

Close #1005. Was rather tricky since we need to detect if the noxfile option is passed.

Changes:

  • Detect if the noxfile option was overridden (by making the default an instance of a custom class).
  • Look for the __main__ module's name if a noxfile isn't passed.
  • Split main and nox_main - this is so nox's own entry point doesn't do the main-script search, while the user-called one does. I thought this was better than exposing the option to control this.

@henryiii
henryiii force-pushed the henryiii/fix/namedscript branch 6 times, most recently from c33250c to 0a3383e Compare October 13, 2025 16:53
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
henryiii force-pushed the henryiii/fix/namedscript branch from 0a3383e to 4fc80e2 Compare October 13, 2025 18:27
@henryiii
henryiii requested a review from Copilot October 13, 2025 20:01

This comment was marked as spam.

@theacodes theacodes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@henryiii
henryiii merged commit c6541cd into wntrblm:main Oct 13, 2025
21 checks passed
@henryiii
henryiii deleted the henryiii/fix/namedscript branch October 13, 2025 21:51
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.

pep 723 interface support for nonstandard noxfile locations

3 participants