Skip to content

Commit 5a9c6e0

Browse files
committed
Fix python workflow
1 parent 40b0012 commit 5a9c6e0

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

.github/workflows/python.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ name: Python Build
99
pull_request:
1010

1111
jobs:
12-
from-sdist:
13-
name: python unit-tests
12+
from_uv:
13+
name: python source distribution
1414
runs-on: ubuntu-latest
1515
steps:
16+
- uses: actions/checkout@v4
1617
- name: Install uv
1718
uses: astral-sh/setup-uv@v5
1819
with:
1920
version: "0.6.5"
2021
- name: "Set up Python"
2122
uses: actions/setup-python@v5
2223
with:
23-
python-version: 3.8
2424
python-version-file: "pyproject.toml"
2525

2626
- name: Install pyssht
@@ -29,28 +29,56 @@ jobs:
2929
- name: run pytest
3030
run: uv run pytest tests/test_pyssht.py
3131

32+
from_sdist:
33+
name: python source distribution
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v5
39+
with:
40+
version: "0.6.5"
41+
- name: "Set up Python"
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version-file: "pyproject.toml"
45+
46+
- name: Build sdist
47+
run: uv build --sdist
48+
49+
- name: install wheel
50+
run:
51+
- uv venv
52+
- "uv pip install dist/pyssht-*.tar.gz"
53+
54+
- name: run pytests
55+
run: uv pip install pytest && uv run pytest tests
56+
3257
build_wheels:
3358
name: Build wheels on ${{ matrix.os }}
3459
runs-on: macos-latest
3560

3661
steps:
62+
- uses: actions/checkout@v4
3763
- name: Install uv
3864
uses: astral-sh/setup-uv@v5
3965
with:
4066
version: "0.6.5"
4167
- name: "Set up Python"
4268
uses: actions/setup-python@v5
4369
with:
44-
python-version: 3.8
70+
python-version-file: "pyproject.toml"
4571

4672
- name: Build wheels
4773
run: uv build --wheel
4874

4975
- name: install wheel
50-
run: "pip install dist/*.whl"
76+
run:
77+
- uv venv
78+
- "uv pip install dist/*.whl"
5179

5280
- name: run pytests
53-
run: uv pip install pytest && pytest tests
81+
run: uv pip install pytest && uv run pytest tests
5482

5583
publication:
5684
name: publish to pypi

0 commit comments

Comments
 (0)