Skip to content

Commit bb465df

Browse files
committed
Test source distributions outside the checkout
AI use: OpenAI Codex based on GPT-5 was used to investigate the artifact layout, draft the workflow and packaging changes, and plan validation. Automated validation included the full test suite. Personal human review and responsibility attestation are pending.
1 parent 7e95ec6 commit bb465df

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,58 @@ jobs:
9292

9393
test-distribution:
9494
name: Check built packages
95+
permissions:
96+
contents: read
9597
runs-on: ubuntu-latest
9698
steps:
9799
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
100+
with:
101+
persist-credentials: false
98102
- name: Install uv and Python
99103
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
100104
with:
101105
enable-cache: false
102106
version: "0.11.6"
103107
- name: Check the release files
104108
run: make test-dist
109+
- name: Upload built packages
110+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
111+
with:
112+
name: built-packages
113+
path: dist/*
114+
115+
test-source-distribution:
116+
name: Test source distribution
117+
needs: test-distribution
118+
permissions: {}
119+
runs-on: ubuntu-latest
120+
steps:
121+
- name: Download built packages
122+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
123+
with:
124+
name: built-packages
125+
path: dist
126+
- name: Install uv and Python 3.14
127+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
128+
with:
129+
enable-cache: false
130+
version: "0.11.6"
131+
python-version: "3.14"
132+
- name: Unpack source distribution
133+
run: |
134+
mkdir source-distribution
135+
tar --extract --gzip --file dist/*.tar.gz --directory source-distribution --strip-components=1
136+
- name: Test source distribution
137+
working-directory: source-distribution
138+
run: uv run --group test pytest
105139

106140
deploy-tag-to-pypi:
107141
# only deploy on tags, see https://stackoverflow.com/a/58478262/1320237
108142
if: startsWith(github.ref, 'refs/tags/v')
109143
needs:
110144
- run-tests
111145
- test-distribution
146+
- test-source-distribution
112147
runs-on: ubuntu-latest
113148
# This environment stores the TWINE_USERNAME and TWINE_PASSWORD
114149
# see https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
@@ -157,6 +192,7 @@ jobs:
157192
needs:
158193
- run-tests
159194
- test-distribution
195+
- test-source-distribution
160196
runs-on: ubuntu-latest
161197
environment:
162198
name: github-release

news/1708.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Source distributions now include all files required to run their test suite, and CI verifies them outside the repository checkout. I used OpenAI Codex based on GPT-5 to assist with this change. @ryux1

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ exclude = [
153153
# Tests for files included in the distribution reside here:
154154
# src/icalendar/tests/test_create_release.sh
155155
"funding.json" = "funding.json"
156+
"generate_windows_to_olson_mapping.py" = "generate_windows_to_olson_mapping.py"
156157

157158
[tool.hatch.build.targets.wheel]
158159
packages = ["src/icalendar"]

0 commit comments

Comments
 (0)