com um clique
add-minimum-job
Add a minimum version test job to a noxfile
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Add a minimum version test job to a noxfile
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Use when dropping a Python version from a project
Use when exploring, triaging, or categorizing all of a repository's GitHub issues, like finding verifiable bugs or grouping issues by topic
Use when a branch and PR is requested explicitly
Use when user asks to secure a repo's CI
Review code quality and packaging usuing sp-repo-review for Scientific Python projects
| name | add-minimum-job |
| description | Add a minimum version test job to a noxfile |
| license | MIT |
This skill helps you add a minimums session to your project's noxfile.py that tests your package with the lowest direct dependencies. This is useful for verifying that your package's declared minimum version constraints are correct.
noxfile.py fileuv should be installed (for the uv venv backend)nox should be availableVerify your noxfile doesn't already have a minimum version test:
grep -E "@nox\.session.*minimum|@nox\.session.*mintest" noxfile.py
If a session already exists, you may want to update it instead of creating a new one.
The minimum version job:
uv as the venv backend for fast environment creation--resolution=lowest-direct to get the minimum allowed versionsAdd this session to your noxfile.py. The exact placement and details depend
on your project structure. Compare to the main "tests" or similar job.
@nox.session(venv_backend="uv", default=False)
def minimums(session: nox.Session) -> None:
"""
Test the minimum versions of dependencies.
"""
session.install("-e.", "--group=test", "--resolution=lowest-direct")
session.run("pytest", *session.posargs)
@nox.session(venv_backend="uv", default=False)
def minimums(session: nox.Session) -> None:
"""
Test with minimum versions of all dependencies.
"""
session.install("-e.[test]", "--resolution=lowest-direct") # Adjust extras as needed
session.run("pytest", *session.posargs)
The best configuration depends on your project. Consider:
--group=test approach-e.[test] approachpython=VERSION--only-binary=:all:session.run("uv", "pip", "list")
This helps debug version resolution issues.
session.install("-e.", "--group=test", "--resolution=lowest-direct")
session.run("pytest", "--cov", "--cov-report=xml", *session.posargs)
Run your new session to verify it works:
# Run the minimums job
nox -s minimums
# Run with specific tests
nox -s minimums -- tests/test_core.py
# Run with pytest options
nox -s minimums -- -v -k specific_test
Check that:
If tests fail:
pyproject.toml or setup.py for the version constraintConsider adding the minimum version job to your GitHub Actions workflow:
- name: Run minimum versions test
run: nox -s minimums
This ensures minimum versions stay valid on every commit.
Solution: This usually means your version constraints are too loose. Review the error message and update minimum versions in pyproject.toml.
Solution: Your code may be using features only available in newer versions. Either:
--resolution=lowest-direct is not recognizedSolution: You need to use the uv backend.
Uses dependency-groups and shows installed versions:
@nox.session(venv_backend="uv", default=False, python=ALL_PYTHONS)
def minimums(session: nox.Session) -> None:
"""
Check minimum requirements.
"""
test_grp = nox.project.dependency_groups(PYPROJECT, "test")
session.install("-e.", "--resolution=lowest-direct", *test_grp, silent=False)
xmlcov_output = (
Path(session.virtualenv.location) / f"coverage-{session.python}-min.xml"
)
session.run(
"pytest",
"--cov",
f"--cov-report=xml:{xmlcov_output}",
"--cov-report=term-missing",
"--cov-context=test",
"tests/",
*session.posargs,
)
Simple and direct:
@nox.session(venv_backend="uv", default=False)
def minimums(session):
"""
Run with the minimum dependencies.
"""
session.install("-e.", "--group=test", "--resolution=lowest-direct")
session.run("uv", "pip", "list")
session.run("pytest", *session.posargs)
Tests the minimum Python version with minimum dependencies:
@nox.session(python=MINIMUM_PYTHON, venv_backend="uv")
def mintest(session: nox.Session) -> None:
"""Run tests on the minimum python version."""
session.install("--only-binary=:all:", "-e.", "--resolution=lowest-direct")
session.install("pytest", "pytest-xdist")
extra_args = session.posargs if session.posargs else ("-n=auto",)
session.run("pytest", *extra_args)
After adding the minimum version job:
nox -s minimums runs without errorsuv pip list (or pip list) shows versions at or near minimumspyproject.toml are accurate