Skip to content

Commit

Permalink
🔨 [nox] Do not hardcode Python versions in @session decorators (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjolowicz authored Nov 27, 2021
1 parent a99f726 commit fb7ebc2
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit fb7ebc2

Please sign in to comment.