Skip to content

Commit 996173d

Browse files
authored
Merge pull request #341 from VirtualPlanetaryLaboratory/fix-pip-install-v2
Fix pip-install: build sdist once, test across matrix
2 parents 96a4402 + 35472e7 commit 996173d

2 files changed

Lines changed: 37 additions & 26 deletions

File tree

.github/workflows/pip-install.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,32 @@ on:
88
jobs:
99

1010
build:
11-
name: 'py${{ matrix.python }} on ${{ matrix.os }}'
11+
name: Build distribution
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
with:
16+
submodules: true
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-python@v5
20+
name: Install Python
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Build sdist
25+
run: |
26+
python -m pip install -U pip build setuptools setuptools_scm wheel
27+
python -m build --sdist
28+
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: dist
32+
path: dist/*
33+
34+
test:
35+
name: 'Test py${{ matrix.python }} on ${{ matrix.os }}'
36+
needs: [build]
1237
runs-on: ${{ matrix.os }}
1338
strategy:
1439
fail-fast: false
@@ -17,41 +42,28 @@ jobs:
1742
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1843

1944
steps:
20-
- uses: actions/checkout@v5
45+
- uses: actions/download-artifact@v4
2146
with:
22-
submodules: true
23-
fetch-depth: 0
47+
name: dist
48+
path: dist
2449

2550
- uses: actions/setup-python@v5
2651
name: Install Python
2752
with:
2853
python-version: ${{ matrix.python }}
2954
allow-prereleases: true
3055

31-
- name: Build
56+
- name: Install from sdist
3257
run: |
33-
python -m pip install -U pip build twine setuptools setuptools_scm wheel
34-
python -m build
58+
python -m venv venv-test
59+
venv-test/bin/python -m pip install dist/vplanet*.tar.gz
3560
36-
- name: Test the sdist
61+
- name: Verify import
3762
run: |
38-
python -m venv venv-sdist
39-
venv-sdist/bin/python -m pip install dist/vplanet*.tar.gz
40-
cd /tmp && "$GITHUB_WORKSPACE/venv-sdist/bin/python" -c "import vplanet; print(vplanet.__version__)"
41-
42-
- name: Test the wheel
43-
run: |
44-
python -m venv venv-wheel
45-
venv-wheel/bin/python -m pip install dist/vplanet*.whl
46-
cd /tmp && "$GITHUB_WORKSPACE/venv-wheel/bin/python" -c "import vplanet; print(vplanet.__version__)"
47-
48-
- uses: actions/upload-artifact@v4
49-
with:
50-
name: dist-${{ matrix.os }}-${{ matrix.python }}
51-
path: dist/*
63+
cd /tmp && "$GITHUB_WORKSPACE/venv-test/bin/python" -c "import vplanet; print(vplanet.__version__)"
5264
5365
upload_pypi:
54-
needs: [build]
66+
needs: [build, test]
5567
runs-on: ubuntu-latest
5668
if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet'
5769
permissions:
@@ -60,8 +72,7 @@ jobs:
6072
steps:
6173
- uses: actions/download-artifact@v4
6274
with:
63-
pattern: dist-*
75+
name: dist
6476
path: dist
65-
merge-multiple: true
6677

6778
- uses: pypa/gh-action-pypi-publish@release/v1

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.35
1+
2.5.36

0 commit comments

Comments
 (0)