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

🔨 [nox] Do not hardcode Python versions in @session decorators #711

Merged
merged 1 commit into from
Nov 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
hook.write_text("\n".join(lines))


@session(name="pre-commit", python="3.10")
@session(name="pre-commit", python=python_versions[0])
def precommit(session: Session) -> None:
"""Lint using pre-commit."""
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
Expand All @@ -107,7 +107,7 @@ def precommit(session: Session) -> None:
activate_virtualenv_in_precommit_hooks(session)


@session(python="3.10")
@session(python=python_versions[0])
def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
requirements = session.poetry.export_requirements()
Expand Down Expand Up @@ -174,7 +174,7 @@ def xdoctest(session: Session) -> None:
session.run("python", "-m", "xdoctest", *args)


@session(name="docs-build", python="3.10")
@session(name="docs-build", python=python_versions[0])
def docs_build(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "docs/_build"]
Expand All @@ -191,7 +191,7 @@ def docs_build(session: Session) -> None:
session.run("sphinx-build", *args)


@session(python="3.10")
@session(python=python_versions[0])
def docs(session: Session) -> None:
"""Build and serve the documentation with live reloading on file changes."""
args = session.posargs or ["--open-browser", "docs", "docs/_build"]
Expand Down