-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnoxfile.py
29 lines (21 loc) · 960 Bytes
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import nox
from laminci.nox import build_docs, install_lamindb, run, run_pre_commit
nox.options.default_venv_backend = "none"
IS_PR = os.getenv("GITHUB_EVENT_NAME") != "push"
@nox.session
def lint(session: nox.Session) -> None:
run_pre_commit(session)
@nox.session
@nox.parametrize("group", ["bionty-unit", "bionty-docs"])
def build(session: nox.Session, group: str):
branch = "featursets" if IS_PR else "main" # point back to "release"
install_lamindb(session, branch=branch)
session.run(*"uv pip install --system -e .[dev]".split())
coverage_args = "--cov=bionty --cov-append --cov-report=term-missing"
if group == "bionty-unit":
session.run(*f"pytest {coverage_args} ./tests".split())
elif group == "bionty-docs":
session.run(*f"pytest -s {coverage_args} ./docs/guide".split())
run(session, "lamin init --storage ./docsbuild --modules bionty")
build_docs(session, strict=False)