Skip to content

Commit 242cfe5

Browse files
authored
github action adopt uv (#57)
1 parent 32e9f23 commit 242cfe5

File tree

3 files changed

+1039
-20
lines changed

3 files changed

+1039
-20
lines changed

.github/workflows/gh-pages.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ name: Deploy Sphinx documentation to Github pages
33
on:
44
push:
55
branches:
6-
- main
6+
- main
7+
8+
env:
9+
UV_SYSTEM_PYTHON: 1
10+
UV_PYTHON_PREFERENCE: system
711

812
jobs:
913
docs:
@@ -14,10 +18,15 @@ jobs:
1418
- name: Set up Python
1519
uses: actions/setup-python@v5
1620
with:
17-
python-version: 3.9
18-
21+
python-version: 3.13
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v3
25+
with:
26+
version: "0.5.1"
27+
1928
- name: Install dependencies
20-
run: pip install -e '.[docs]'
29+
run: uv pip install -e '.[docs]'
2130

2231
- name: Build docs
2332
run: sphinx-build docs ./docs/_build/html/

.github/workflows/test.yml

+30-16
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@ name: Testing Central Dogma Python
33
on:
44
push:
55
branches:
6-
- main
6+
- main
77
pull_request:
88

9+
env:
10+
UV_SYSTEM_PYTHON: 1
11+
UV_PYTHON_PREFERENCE: system
12+
913
jobs:
1014
docs:
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@v4
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
20+
with:
21+
version: "0.5.1"
1422
- name: Set up Python
1523
uses: actions/setup-python@v5
1624
with:
17-
python-version: 3.9
25+
python-version: 3.13
1826
- name: Install dependencies
19-
run: pip install -e '.[docs]'
20-
- name : Build docs
27+
run: uv pip install -e '.[docs]'
28+
- name: Build docs
2129
run: sphinx-build docs ./docs/_build/html/
2230

2331
linter:
@@ -35,7 +43,8 @@ jobs:
3543
strategy:
3644
matrix:
3745
os: [ubuntu-latest]
38-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
46+
python-version:
47+
["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
3948

4049
steps:
4150
- uses: actions/checkout@v4
@@ -46,14 +55,16 @@ jobs:
4655
uses: actions/setup-python@v5
4756
with:
4857
python-version: ${{ matrix.python-version }}
49-
cache: "pip"
50-
cache-dependency-path: "**/pyproject.toml"
58+
59+
- name: Install uv
60+
uses: astral-sh/setup-uv@v3
61+
with:
62+
version: "0.5.1"
63+
enable-cache: true
5164

5265
- name: Install dependencies
5366
run: |
54-
python -m pip install --upgrade pip
55-
pip install -e .
56-
pip install -e '.[dev]'
67+
uv pip install -r pyproject.toml --extra dev
5768
5869
- name: Test with pytest
5970
run: |
@@ -71,22 +82,25 @@ jobs:
7182
strategy:
7283
matrix:
7384
os: [macos-latest, windows-latest]
74-
python-version: ["3.9", "3.10", "3.11","3.12", "3.13", "pypy3.9", "pypy3.10"]
85+
python-version:
86+
["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
7587

7688
steps:
7789
- uses: actions/checkout@v4
90+
- name: Install uv
91+
uses: astral-sh/setup-uv@v3
92+
with:
93+
version: "0.5.1"
94+
enable-cache: true
95+
7896
- name: Set up Python ${{ matrix.python-version }}
7997
uses: actions/setup-python@v5
8098
with:
8199
python-version: ${{ matrix.python-version }}
82-
cache: "pip"
83-
cache-dependency-path: "**/pyproject.toml"
84100

85101
- name: Install dependencies
86102
run: |
87-
python -m pip install --upgrade pip
88-
pip install -e .
89-
pip install -e '.[dev]'
103+
uv pip install -r pyproject.toml --extra dev
90104
91105
- name: Test with pytest
92106
run: |

0 commit comments

Comments
 (0)