Skip to content

Commit

Permalink
Try to fixup path for coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Dec 16, 2024
1 parent 498c0bf commit 354f55a
Showing 1 changed file with 35 additions and 22 deletions.
57 changes: 35 additions & 22 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,22 @@ def precommit(session: nox.Session) -> None:
"--hook-stage=manual",
"--show-diff-on-failure",
]
session.run("uv", "sync", "--group", "dev", "--group", "lint", external=True)
session.install(
"ruff",
"pre-commit",
"pre-commit-hooks",
"pydoclint",
session.run_install(
"uv",
"sync",
"--group",
"dev",
"--group",
"lint",
# external=True,
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
# session.install(
# "ruff",
# "pre-commit",
# "pre-commit-hooks",
# "pydoclint",
# )
session.run("pre-commit", *args)
if args and args[0] == "install":
activate_virtualenv_in_precommit_hooks(session)
Expand Down Expand Up @@ -170,13 +179,13 @@ def mypy(session: nox.Session) -> None:
@nox.session(python=python_versions)
def tests(session: nox.Session) -> None:
"""Run the test suite."""
session.run_install(
session.run(
"uv",
"sync",
"--group",
"dev",
"--group",
"lint",
# "--group",
# "lint",
"--extra",
"googlevision",
"--extra",
Expand All @@ -190,16 +199,14 @@ def tests(session: nox.Session) -> None:
"--extra",
"pyyaml",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
# external=True
)
session.run(
"python",
"-c",
'"import google.cloud.vision; import google.cloud.storage"',
external=True,
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.env["PYTHONPATH"] = "src"
session.install("pytest-mock")

try:
session.run(
Expand All @@ -208,7 +215,6 @@ def tests(session: nox.Session) -> None:
"--parallel",
"-m",
"pytest",
external=True,
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
finally:
Expand All @@ -220,13 +226,20 @@ def tests(session: nox.Session) -> None:
def coverage(session: nox.Session) -> None:
"""Produce the coverage report."""
args = session.posargs or ["report"]
session.run(
# session.run(
# "uv",
# "pip",
# "install",
# "coverage[toml]",
# env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
# # external=True,
# )
session.run_install(
"uv",
"pip",
"install",
"coverage[toml]",
"sync",
"--group",
"dev",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
external=True,
)
if not session.posargs and any(Path().glob(".coverage.*")):
session.run("coverage", "combine")
Expand All @@ -247,7 +260,7 @@ def typeguard(session: nox.Session) -> None:
"--group",
"typeguard",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
external=True,
# external=True,
)
session.run(
"pytest",
Expand Down Expand Up @@ -276,7 +289,7 @@ def xdoctest(session: nox.Session) -> None:
"--group",
"xdoctest",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
external=True,
# external=True,
)
session.run("python", "-m", "xdoctest", *args)

Expand All @@ -296,7 +309,7 @@ def docs_build(session: nox.Session) -> None:
"--group",
"dev",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
external=True,
# external=True,
)

build_dir = Path("docs", "_build")
Expand All @@ -317,7 +330,7 @@ def docs(session: nox.Session) -> None:
"dev",
"--group",
"docs",
external=True,
# external=True,
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)

Expand Down

0 comments on commit 354f55a

Please sign in to comment.