diff options
-rw-r--r-- | noxfile.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -6,6 +6,7 @@ import nox from nox.sessions import Session package = "text-recognizer" +versions = ["3.9"] nox.options.sessions = "lint", "mypy", "safety", "tests" locations = ( "text_recognizer", @@ -44,7 +45,7 @@ def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> Non session.install(f"--constraint={requirements.name}", *args, **kwargs) -@nox.session(python="3.9") +@nox.session(python=versions) def black(session: Session) -> None: """Run black code formatter.""" args = session.posargs or locations @@ -52,7 +53,7 @@ def black(session: Session) -> None: session.run("black", *args) -@nox.session(python=["3.9"]) +@nox.session(python=versions) def lint(session: Session) -> None: """Lint using flake8.""" args = session.posargs or locations @@ -70,7 +71,7 @@ def lint(session: Session) -> None: session.run("flake8", *args) -@nox.session(python="3.9") +@nox.session(python=versions) def safety(session: Session) -> None: """Scan dependencies for insecure packages.""" with tempfile.NamedTemporaryFile() as requirements: @@ -87,7 +88,7 @@ def safety(session: Session) -> None: session.run("safety", "check", f"--file={requirements.name}", "--full-report") -@nox.session(python=["3.9"]) +@nox.session(python=versions) def mypy(session: Session) -> None: """Type-check using mypy.""" args = session.posargs or locations @@ -95,7 +96,7 @@ def mypy(session: Session) -> None: session.run("mypy", *args) -@nox.session(python=["3.9"]) +@nox.session(python=versions) def tests(session: Session) -> None: """Run the test suite.""" args = session.posargs or ["--cov", "-m", "not e2e"] @@ -106,7 +107,7 @@ def tests(session: Session) -> None: session.run("pytest", *args) -@nox.session(python=["3.9"]) +@nox.session(python=versions) def typeguard(session: Session) -> None: """Runtime type checking using Typeguard.""" args = session.posargs or ["-m", "not e2e"] |