Skip to content

Commit

Permalink
Fix env stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jayqi committed Mar 18, 2024
1 parent 16f7b79 commit f0a9b06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
- name: Build distribution and test installation
shell: bash
run: |
nox -s build
nox -s test_wheel-${{ matrix.python-version }} --verbose
nox -s test_sdist-${{ matrix.python-version }} --verbose
Expand Down
26 changes: 14 additions & 12 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import nox


@nox.session(python="3.11", reuse_venv=True)
@nox.session(venv_backend="mamba|conda", python="3.11", reuse_venv=True)
def dev(session):
session.conda_install("graphviz", channel="conda-forge")
session.install("-r", "requirements/dev.txt")
Expand Down Expand Up @@ -33,37 +33,39 @@ def tests(session):
session.run("pytest", "-vv")


@nox.session(venv_backend="uv|virtualenv", reuse_venv=True)
def build(session):
session.install("build")
session.run("python", "-m", "build")


@nox.session(
venv_backend="uv|virtualenv",
venv_backend="mamba|conda",
python=["3.8", "3.9", "3.10", "3.11", "3.12"],
reuse_venv=False,
)
def test_wheel(session):
session.install("build")
session.run("python", "-m", "build")
session.conda_install("graphviz", channel="conda-forge")
wheel_path = next(Path("dist").glob("*.whl"))
session.install(f"erdantic@file://{wheel_path}")
session.run("erdantic", "--version")


@nox.session(
venv_backend="uv|virtualenv",
venv_backend="mamba|conda",
python=["3.8", "3.9", "3.10", "3.11", "3.12"],
reuse_venv=False,
)
def test_sdist(session):
session.install("build")
session.run("python", "-m", "build")
session.conda_install("graphviz", channel="conda-forge")

sdist_path = next(Path("dist").glob("*.tar.gz"))
session.install(f"erdantic@file://{sdist_path}")
session.run("erdantic", "--version")


@nox.session(
venv_backend="uv|virtualenv",
python="3.11",
reuse_venv=True,
)
@nox.session(venv_backend="mamba|conda", python="3.11", reuse_venv=True)
def docs(session):
session.conda_install("graphviz", channel="conda-forge")
session.install("-r", "requirements/docs.txt")
session.run("make", "docs")

0 comments on commit f0a9b06

Please sign in to comment.