diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 80bff2cc..1662fa81 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -46,7 +46,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip nox + python -m pip install --upgrade pip "nox[uv]" - name: Integration tests run: | @@ -82,7 +82,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip nox + python -m pip install --upgrade pip nox[uv] - name: Unit tests run: | @@ -107,7 +107,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip nox + python -m pip install --upgrade pip nox[uv] - name: Run examples run: | @@ -134,7 +134,7 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip nox + python -m pip install --upgrade pip "nox[uv]" - name: Run coverage tests for Ubuntu with Python 3.12 and generate report run: nox -s coverage diff --git a/noxfile.py b/noxfile.py index 4ebdcfec..502cdc1e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -4,7 +4,8 @@ # nox options nox.options.reuse_existing_virtualenvs = True -nox.options.venv_backend = "virtualenv" +nox.options.force_venv_backend = "uv" +nox.needs_version = ">=2024.4.15" # Environment variables to control CI behaviour for nox sessions PYBOP_SCHEDULED = int(os.environ.get("PYBOP_SCHEDULED", 0)) @@ -22,6 +23,7 @@ def unit(session): @nox.session def coverage(session): session.install("-e", ".[all,dev]", silent=False) + session.install("pip") if PYBOP_SCHEDULED: session.run("pip", "install", f"pybamm=={PYBAMM_VERSION}", silent=False) session.run("pytest", "--unit", "--cov", "--cov-append", "--cov-report=xml") @@ -40,6 +42,7 @@ def coverage(session): @nox.session def plots(session): session.install("-e", ".[plot,dev]", silent=False) + session.install("pip") session.run("pytest", "--plots", "-n", "0") diff --git a/pyproject.toml b/pyproject.toml index 2d93faa7..14ec41be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ docs = [ "myst-parser", ] dev = [ - "nox", + "nox[uv]", "nbmake", "pre-commit", "pytest>=6",