Skip to content

Commit 4c0f8d6

Browse files
committed
Change to uv
1 parent 397a326 commit 4c0f8d6

File tree

13 files changed

+3302
-539
lines changed

13 files changed

+3302
-539
lines changed

.github/workflows/build_docs.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,26 @@ jobs:
1212
build_docs:
1313
runs-on: ubuntu-24.04
1414
env:
15-
PYTHON_VERSION: "3.12"
1615
PUBLISH_DIR: ./_build/html
1716

1817
steps:
1918
# checkout the repository
2019
- uses: actions/checkout@v5
2120

2221
# setup Python
23-
- name: Install Python ${{ env.PYTHON_VERSION }}
22+
- name: Install Python
2423
uses: actions/setup-python@v6
2524
with:
26-
python-version: ${{ env.PYTHON_VERSION }}
25+
python-version-file: ".python-version"
2726

28-
# preserve pip cache to speed up installation
29-
- name: Cache pip
30-
uses: actions/cache@v4
31-
with:
32-
path: ~/.cache/pip
33-
# Look to see if there is a cache hit for the corresponding requirements file
34-
key: ${{ runner.os }}-pip-${{ hashFiles('*requirements-docs.txt') }}
35-
restore-keys: |
36-
${{ runner.os }}-pip-${{ hashFiles('requirements-docs.txt') }}
37-
- name: Install Python dependencies
38-
run: |
39-
python3 -m pip install --upgrade pip
40-
python3 -m pip install -r requirements-docs.txt
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v6
29+
30+
- name: Install the project
31+
run: uv sync --extras docs
4132

4233
- name: Build docs
43-
run: python3 -m jupyter book build .
34+
run: uv run jupyter book build .
4435

4536
- name: Upload artifact
4637
uses: actions/upload-artifact@v5

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
# This action sets the current path to the root of your github repo
1515
- uses: actions/checkout@v5
1616

17+
- name: Install Python
18+
uses: actions/setup-python@v6
19+
1720
- name: Install pre-commit
1821
run: python3 -m pip install pre-commit
1922

.github/workflows/reproduce_results.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,26 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v5
2626

27-
- name: Setup Python
27+
# setup Python
28+
- name: Install Python
2829
uses: actions/setup-python@v6
2930
with:
30-
python-version: "3.12"
31+
python-version-file: ".python-version"
3132

32-
- name: Cache
33-
id: cache
34-
uses: actions/cache@v4
35-
with:
36-
path: |
37-
~/.cache/pip
38-
key: cache_v1
39-
restore-keys: |
40-
cache_v1
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v6
4135

42-
- name: Install dependencies
43-
run: python3 -m pip install -r requirements.txt
36+
- name: Install the project
37+
run: uv sync
4438

4539
- name: Run pre-processing
46-
run: python3 code/pre_processing.py --datapath=${{ env.DATAPATH }}
40+
run: uv run python3 code/pre_processing.py --datapath=${{ env.DATAPATH }}
4741

4842
- name: Run simulation
49-
run: python3 code/run_all.py --resultdir=${{ env.RESULTDIR }}
43+
run: uv run python3 code/run_all.py --resultdir=${{ env.RESULTDIR }}
5044

5145
- name: Postprocess
52-
run: python3 code/postprocess.py --resultdir=${{ env.RESULTDIR }} --datapath=${{ env.DATAPATH }} --figdir=${{ env.FIGDIR }}
46+
run: uv run python3 code/postprocess.py --resultdir=${{ env.RESULTDIR }} --datapath=${{ env.DATAPATH }} --figdir=${{ env.FIGDIR }}
5347

5448
- name: Upload artifact
5549
if: always()

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@ Provide the abstract of the paper
1111

1212
## Getting started
1313

14-
We provide a pre-build Docker image which can be used to run the the code in this repository. First thing you need to do is to ensure that you have [docker installed](https://docs.docker.com/get-docker/).
14+
First install `uv`
15+
```bash
16+
curl -LsSf https://astral.sh/uv/install.sh | sh
17+
```
18+
Then create a virtual environment and install dependencies
19+
20+
```bash
21+
uv venv
22+
source .venv/bin/activate
23+
uv sync --locked --all-extras --dev
24+
```
25+
26+
We also provide a pre-build Docker image which can be used to run the the code in this repository. First thing you need to do is to ensure that you have [docker installed](https://docs.docker.com/get-docker/).
1527

1628
To start an interactive docker container you can execute the following command
1729

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ sphinx:
5151
- "sphinxcontrib.bibtex"
5252

5353

54-
exclude_patterns: [".pytest_cache/*", ".github/*"]
54+
exclude_patterns: [".pytest_cache/*", ".github/*", "venv/*", ".venv/*"]

cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"nagumo",
1313
"postprocess",
1414
"scientificcomputing",
15-
"zenodo"
15+
"zenodo",
16+
"venv"
1617
],
1718
"ignoreWords": [],
1819
"import": []

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "my-paper"
77
version = "1.2.0"
8+
requires-python = ">=3.10"
89
dependencies = [
910
"ap_features",
1011
"matplotlib",

requirements-dev.txt

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

0 commit comments

Comments
 (0)