Skip to content

Commit

Permalink
chore: support NOX_DEFAULT_VENV_BACKEND=uv
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Mar 5, 2024
1 parent ef0b4df commit ab559ae
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def tests(session: nox.Session) -> None:
Run the unit and regular tests.
"""
unit_test_args = ["--run-docker"] if sys.platform.startswith("linux") else []
session.install("-e", ".[test]")
session.install("-e.[test]")
if session.posargs:
session.run("pytest", *session.posargs)
else:
Expand All @@ -44,7 +44,7 @@ def pylint(session: nox.Session) -> None:
Run pylint.
"""

session.install("pylint", ".")
session.install("pylint", "cibuildwheel @ .")
session.run("pylint", "cibuildwheel", *session.posargs)


Expand All @@ -63,7 +63,10 @@ def update_constraints(session: nox.Session) -> None:
"""
Update the dependencies inplace.
"""
session.install("uv")

if getattr(session.virtualenv, "venv_backend", "") != "uv":
session.install("uv")

for minor_version in range(7, 13):
python_version = f"3.{minor_version}"
env = os.environ.copy()
Expand Down Expand Up @@ -103,7 +106,7 @@ def update_proj(session: nox.Session) -> None:
"""
Update the README inplace.
"""
session.install("-e", ".[bin]")
session.install("-e.[bin]")
session.run(
"python",
"bin/projects.py",
Expand All @@ -126,18 +129,10 @@ def generate_schema(session: nox.Session) -> None:
@nox.session(python="3.9")
def docs(session: nox.Session) -> None:
"""
Build the docs.
Build the docs. Will serve unless --non-interactive
"""
session.install("-e", ".[docs]")
session.run("pip", "list")

if session.posargs:
if "serve" in session.posargs:
session.run("mkdocs", "serve")
else:
session.error("Unrecognized args, use 'serve'")
else:
session.run("mkdocs", "build")
session.install("-e.[docs]")
session.run("mkdocs", "serve" if session.interactive else "build")


@nox.session
Expand Down

0 comments on commit ab559ae

Please sign in to comment.