Skip to content

Commit

Permalink
Merge pull request #287 from pybop-team/286-add-uv-support-for-ci
Browse files Browse the repository at this point in the history
Change nox backend to `uv`
  • Loading branch information
BradyPlanden committed Apr 21, 2024
2 parents 6ba3d04 + 3667787 commit 57e0e83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand All @@ -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: |
Expand All @@ -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

Expand Down
5 changes: 4 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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")
Expand All @@ -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")


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ docs = [
"myst-parser",
]
dev = [
"nox",
"nox[uv]",
"nbmake",
"pre-commit",
"pytest>=6",
Expand Down

0 comments on commit 57e0e83

Please sign in to comment.