Skip to content

Commit

Permalink
Merge pull request #50 from ayasyrev:nox_fix
Browse files Browse the repository at this point in the history
nox uv + ruff
  • Loading branch information
ayasyrev authored Jul 20, 2024
2 parents 283a44b + 0a12aa6 commit 706364d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
8 changes: 2 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import nox


@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"], venv_backend="uv")
def tests(session):
args = session.posargs or ["--cov"]
session.install(
".",
"pytest",
"pytest-cov",
)
session.install("-e .[test]")
session.run("pytest", *args)
4 changes: 2 additions & 2 deletions noxfile_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"], venv_backend="mamba")
def conda_tests(session):
args = session.posargs or ["--cov"]
session.conda_install("--file", "requirements_test.txt")
session.install("-e", ".")
session.conda_install("uv")
session.run("uv", "pip", "install", "-e .[test]")
session.run("pytest", *args)
6 changes: 3 additions & 3 deletions noxfile_conda_lint.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import nox

locations = "src/benchmark_utils", "tests", "noxfile.py"
locations = "."


@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"], venv_backend="mamba")
def conda_lint(session):
args = session.posargs or locations
session.conda_install("flake8")
session.run("flake8", *args)
session.conda_install("ruff")
session.run("ruff", "check", *args)
6 changes: 3 additions & 3 deletions noxfile_cov.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import nox


@nox.session(python=["3.11"])
@nox.session(python=["3.11"], venv_backend="uv")
def tests_cov(session):
args = session.posargs or ["--cov"]
session.install(".", "pytest", "pytest-cov", "coverage[toml]")
session.install("-e .[test]", "coverage[toml]")
session.run("pytest", *args)


@nox.session(python="3.10")
@nox.session(python="3.11", venv_backend="uv")
def coverage(session) -> None:
"""Upload coverage data."""
session.install("coverage[toml]", "codecov")
Expand Down
10 changes: 5 additions & 5 deletions noxfile_lint.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import nox

locations = "src/benchmark_utils", "tests", "noxfile.py"
locations = "."


@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
def lint(session):
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"], venv_backend="uv")
def lint_ruff(session):
args = session.posargs or locations
session.install("flake8")
session.run("flake8", *args)
session.install("ruff")
session.run("ruff", "check", *args)

0 comments on commit 706364d

Please sign in to comment.