Skip to content

Commit d9886da

Browse files
ci: use baipp to build both packages and test them together
Updates the CI pipeline to use hynek/build-and-inspect-python-package@v2 for both packages: Package job changes: - Build vcs-versioning using baipp with 'path: nextgen/vcs-versioning' - Build setuptools-scm using baipp at repo root - Download both artifacts and combine into 'All-Packages' artifact Test job changes: - Download 'All-Packages' artifact containing both wheels - Install vcs-versioning wheel first (dependency) - Install setuptools-scm wheel second - Run tests for both packages: 'testing/' and 'nextgen/vcs-versioning/testingB/' - Tests run against installed wheels instead of source code Distribution jobs updated: - dist_upload, upload-release-assets, test-pypi-upload now use 'All-Packages' - Both packages will be uploaded to PyPI on release This ensures proper packaging validation for both packages and tests them as they would be installed by end users.
1 parent dfd8305 commit d9886da

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

.github/workflows/python-tests.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121

2222
package:
23-
name: Build & inspect our package.
23+
name: Build & inspect our packages
2424
runs-on: ubuntu-latest
2525
env:
2626
# Use no-local-version for package builds to ensure clean versions for PyPI uploads
@@ -31,7 +31,32 @@ jobs:
3131
with:
3232
fetch-depth: 0
3333

34-
- uses: hynek/build-and-inspect-python-package@v2
34+
- name: Build vcs-versioning
35+
uses: hynek/build-and-inspect-python-package@v2
36+
with:
37+
path: nextgen/vcs-versioning
38+
39+
- name: Build setuptools-scm
40+
uses: hynek/build-and-inspect-python-package@v2
41+
42+
- name: Download vcs-versioning packages
43+
uses: actions/download-artifact@v5
44+
with:
45+
name: Packages-nextgen-vcs-versioning
46+
path: dist/
47+
48+
- name: Download setuptools-scm packages
49+
uses: actions/download-artifact@v5
50+
with:
51+
name: Packages
52+
path: dist/
53+
54+
- name: Upload combined packages
55+
uses: actions/upload-artifact@v5
56+
with:
57+
name: All-Packages
58+
path: dist/
59+
if-no-files-found: error
3560

3661
test:
3762
needs: [package]
@@ -98,16 +123,22 @@ jobs:
98123
- run: uv sync --group test --group docs --extra rich
99124
- uses: actions/download-artifact@v5
100125
with:
101-
name: Packages
126+
name: All-Packages
102127
path: dist
103-
- shell: bash
104-
run: uv pip install "$(echo -n dist/*whl)"
128+
- name: Install built wheels
129+
shell: bash
130+
run: |
131+
# Install vcs-versioning first (dependency of setuptools-scm)
132+
uv pip install dist/vcs_versioning-*.whl
133+
# Then install setuptools-scm
134+
uv pip install dist/setuptools_scm-*.whl
105135
- run: |
106136
$(hg debuginstall --template "{pythonexe}") -m pip install hg-git --user
107137
if: matrix.os == 'ubuntu-latest'
108138
# this hopefully helps with os caches, hg init sometimes gets 20s timeouts
109139
- run: hg version
110-
- run: uv run pytest
140+
- name: Run tests for both packages
141+
run: uv run pytest testing/ nextgen/vcs-versioning/testingB/
111142
timeout-minutes: 25
112143

113144
dist_upload:
@@ -120,7 +151,7 @@ jobs:
120151
steps:
121152
- uses: actions/download-artifact@v5
122153
with:
123-
name: Packages
154+
name: All-Packages
124155
path: dist
125156
- name: Publish package to PyPI
126157
uses: pypa/gh-action-pypi-publish@release/v1
@@ -134,7 +165,7 @@ jobs:
134165
steps:
135166
- uses: actions/download-artifact@v5
136167
with:
137-
name: Packages
168+
name: All-Packages
138169
path: dist
139170
- name: Upload release assets
140171
uses: softprops/action-gh-release@v2
@@ -151,7 +182,7 @@ jobs:
151182
steps:
152183
- uses: actions/download-artifact@v5
153184
with:
154-
name: Packages
185+
name: All-Packages
155186
path: dist
156187
- name: Publish package to PyPI
157188
continue-on-error: true

0 commit comments

Comments
 (0)