Skip to content

Commit da6eaf3

Browse files
authored
Merge pull request #915 from alan-turing-institute/update-workflows
Update workflows to use uv (#876)
2 parents 20093a1 + 9689f5d commit da6eaf3

File tree

6 files changed

+40
-24
lines changed

6 files changed

+40
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ jobs:
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838

39+
- name: Install uv
40+
uses: astral-sh/setup-uv@v7
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
enable-cache: true
44+
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
45+
activate-environment: true
46+
3947
- name: Install dependencies
4048
run: |
41-
python -m pip install --upgrade pip
42-
pip install -e .[dev,spatiotemporal]
49+
uv pip install -e .[dev,spatiotemporal]
4350
4451
- name: Test with pytest
4552
run: |

.github/workflows/docs.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ jobs:
2424
- uses: actions/setup-python@v5
2525
with:
2626
python-version: 3.12
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
29+
with:
30+
python-version: 3.12
31+
enable-cache: true
32+
cache-suffix: docs
33+
activate-environment: true
2734
- uses: nikeee/setup-pandoc@v1
28-
- name: "Upgrade pip"
29-
run: pip install --upgrade pip
30-
- name: "Install jupyterbook"
31-
run: pip install -r docs/requirements.txt
32-
- name: "Install autoemulate"
33-
run: pip install -e .
35+
- name: "Install autoemulate with extras: dev, docs"
36+
run: uv pip install -e .[dev,docs]
3437
- name: "Run jupyterbook"
3538
run: jupyter-book build docs --all
3639
- name: "Deploy"

.github/workflows/precommit.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ jobs:
3030
- uses: actions/setup-python@v5
3131
with:
3232
python-version: "3.12"
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v7
35+
with:
36+
python-version: "3.12"
37+
enable-cache: true
38+
cache-suffix: precommit
39+
activate-environment: true
3340
- name: Install dependencies
3441
run: |
35-
python -m venv .venv
36-
source .venv/bin/activate
37-
python -m pip install --upgrade pip
38-
pip install -e .[dev,spatiotemporal]
42+
uv pip install -e .[dev,spatiotemporal]
3943
40-
- uses: pre-commit/[email protected]
41-
with:
42-
extra_args: --hook-stage manual --all-files
44+
- name: Run pre-commit
45+
run: uv run pre-commit run --hook-stage manual --all-files

.github/workflows/release.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,24 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Set up Python
16-
uses: actions/setup-python@v4
16+
uses: actions/setup-python@v5
1717
with:
1818
python-version: '3.10'
1919

20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v7
22+
with:
23+
python-version: '3.10'
24+
enable-cache: true
25+
cache-suffix: release
26+
activate-environment: true
27+
2028
- name: Install dependencies
2129
run: |
22-
python -m pip install --upgrade pip
23-
pip install build twine
30+
uv pip install build twine
2431
2532
- name: Build package
2633
run: python -m build

docs/requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dev = [
6161
"sphinx-autodoc-typehints>=1.24.0",
6262
"black>=23.10.1",
6363
"pre-commit>=3.5.0",
64-
"jupyter-book>=1.0.0",
64+
"jupyter-book>=1.0.0,<2.0.0",
6565
"pytest-cov>=4.1.0",
6666
"coverage>=7.6.4",
6767
"plotnine>=0.13.6",

0 commit comments

Comments
 (0)