-
Notifications
You must be signed in to change notification settings - Fork 2
👷 build: update nox #38
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,104 +1,70 @@ | ||||||
| """Nox sessions.""" | ||||||
| """Nox setup.""" | ||||||
|
|
||||||
| import shutil | ||||||
| from pathlib import Path | ||||||
|
|
||||||
| import nox | ||||||
|
|
||||||
| DIR = Path(__file__).parent.resolve() | ||||||
| from nox_uv import session | ||||||
|
|
||||||
| nox.needs_version = ">=2024.3.2" | ||||||
| nox.options.sessions = [ | ||||||
| # Linting | ||||||
| "lint", | ||||||
| "pylint", | ||||||
| "precommit", | ||||||
| # Testing | ||||||
| "tests", | ||||||
| # Packaging | ||||||
| "build", | ||||||
| ] | ||||||
| nox.options.default_venv_backend = "uv" | ||||||
|
|
||||||
| DIR = Path(__file__).parent.resolve() | ||||||
|
|
||||||
| # ============================================================================= | ||||||
| # Linting | ||||||
|
|
||||||
|
|
||||||
| @nox.session(venv_backend="uv") | ||||||
| def lint(session: nox.Session, /) -> None: | ||||||
| @session(uv_groups=["lint"], reuse_venv=True) | ||||||
|
||||||
| @session(uv_groups=["lint"], reuse_venv=True) | |
| @session(reuse_venv=True) |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test session uses s.notify() to delegate to the pytest session but doesn't need the uv_groups=["test"] parameter since it only notifies and doesn't run any commands itself. This causes unnecessary dependency installation overhead.
| @session(uv_groups=["test"], reuse_venv=True) | |
| @session(reuse_venv=True) |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build session calls rm_build(s) directly as a Python function, but rm_build is decorated with @session which makes it a nox session. This mixing of session invocation patterns is inconsistent. Either use s.notify("rm_build") to invoke it as a session, or remove the @session decorator from rm_build and make it a plain helper function.
| rm_build(s) | |
| s.notify("rm_build") |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -46,16 +46,22 @@ build-backend = "hatchling.build" | |||
| dev = [ | ||||
| "ipykernel>=6.29.5", | ||||
| "cz-conventional-gitmoji>=0.6.1", | ||||
| {include-group = "build"}, | ||||
|
||||
| {include-group = "build"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
formatjob usesastral-sh/setup-uv@v6(unpinned) while thetestsjob usesastral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2(pinned with commit hash). These should be consistent - either both should use pinned versions with commit hashes for security and reproducibility, or both should use version tags. The recommended practice is to pin both with commit hashes.