From edb1f19398a226e0de3adcd97a659f22a1938569 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Wed, 10 Apr 2024 18:20:47 +0100 Subject: [PATCH 1/5] Change nox backend to uv, updt nox with optional dependency --- noxfile.py | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 4ebdcfec..e6c03e0f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -4,7 +4,7 @@ # nox options nox.options.reuse_existing_virtualenvs = True -nox.options.venv_backend = "virtualenv" +nox.options.force_venv_backend = "uv" # Environment variables to control CI behaviour for nox sessions PYBOP_SCHEDULED = int(os.environ.get("PYBOP_SCHEDULED", 0)) @@ -40,6 +40,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 3663ba67..2bd54361 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ docs = [ "myst-parser", ] dev = [ - "nox", + "nox[uv]", "nbmake", "pre-commit", "pytest>=6", From 0ead680fa11be8f9a3e4a740479604813c64aa4b Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Wed, 10 Apr 2024 18:25:41 +0100 Subject: [PATCH 2/5] update nox install in workflow --- .github/workflows/test_on_push.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index c58ef5e5..c079f0fd 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 From 8f3434d888cbc05d7d682580600f8f8ee3ff135b Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Wed, 10 Apr 2024 19:30:15 +0100 Subject: [PATCH 3/5] add pip install to coverage --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index e6c03e0f..82cd5f85 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,6 +22,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") From 88e4ecbac03a18f3592ae79a3c3f233d5646271d Mon Sep 17 00:00:00 2001 From: Brady Planden <55357039+BradyPlanden@users.noreply.github.com> Date: Fri, 19 Apr 2024 20:49:43 +0100 Subject: [PATCH 4/5] Update noxfile.py Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index 82cd5f85..41c9daae 100644 --- a/noxfile.py +++ b/noxfile.py @@ -5,6 +5,7 @@ # nox options nox.options.reuse_existing_virtualenvs = True 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)) From 437747eb3054c2d701c63f620be6d7d6e8f33832 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:50:13 +0000 Subject: [PATCH 5/5] style: pre-commit fixes --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 41c9daae..502cdc1e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -5,7 +5,7 @@ # nox options nox.options.reuse_existing_virtualenvs = True nox.options.force_venv_backend = "uv" -nox.needs_version = ">=2024.4.15" +nox.needs_version = ">=2024.4.15" # Environment variables to control CI behaviour for nox sessions PYBOP_SCHEDULED = int(os.environ.get("PYBOP_SCHEDULED", 0))