Fix pip-install workflow to prevent artifact corruption#34
Conversation
The previous workflow built distribution files on every OS/Python combination, then tried to merge all artifacts together. This caused tarball corruption during PyPI upload with 'zlib.error: invalid distance too far back'. For pure Python packages, distribution files should be built only once. Changes: - Split workflow into three jobs: build, test, upload_pypi - Build job: Runs once on ubuntu-latest with Python 3.11, creates sdist and wheel - Test job: Downloads built artifacts and tests installation on all OS/Python combinations - Upload job: Depends on both build and test, uploads single set of artifacts to PyPI This prevents multiple builds of the same files and eliminates artifact conflicts.
Test Results (py3.9 on ubuntu-24.04)48 tests 48 ✅ 1m 9s ⏱️ Results for commit 8e0340a. |
Test Results (py3.9 on ubuntu-22.04)48 tests 48 ✅ 1m 19s ⏱️ Results for commit 8e0340a. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
=======================================
Coverage 72.42% 72.42%
=======================================
Files 2 2
Lines 486 486
=======================================
Hits 352 352
Misses 134 134
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Test Results (py3.11 on ubuntu-24.04)48 tests 48 ✅ 1m 15s ⏱️ Results for commit 8e0340a. |
Test Results (py3.14 on ubuntu-22.04)48 tests 48 ✅ 1m 4s ⏱️ Results for commit 8e0340a. |
Test Results (py3.14 on ubuntu-24.04)48 tests 48 ✅ 1m 7s ⏱️ Results for commit 8e0340a. |
Test Results (py3.10 on ubuntu-24.04)48 tests 48 ✅ 1m 22s ⏱️ Results for commit 8e0340a. |
Test Results (py3.11 on ubuntu-22.04)48 tests 48 ✅ 1m 25s ⏱️ Results for commit 8e0340a. |
Test Results (py3.10 on ubuntu-22.04)48 tests 48 ✅ 1m 28s ⏱️ Results for commit 8e0340a. |
Test Results (py3.13 on ubuntu-24.04)48 tests 48 ✅ 1m 23s ⏱️ Results for commit 8e0340a. |
Test Results (py3.13 on ubuntu-22.04)48 tests 48 ✅ 1m 35s ⏱️ Results for commit 8e0340a. |
Test Results (py3.12 on ubuntu-22.04)48 tests 48 ✅ 2m 27s ⏱️ Results for commit 8e0340a. |
Test Results (py3.12 on ubuntu-24.04)48 tests 48 ✅ 2m 32s ⏱️ Results for commit 8e0340a. |
The previous workflow built distribution files on every OS/Python combination, then tried to merge all artifacts together. This caused tarball corruption during PyPI upload with 'zlib.error: invalid distance too far back'.
For pure Python packages, distribution files should be built only once.
Changes:
This prevents multiple builds of the same files and eliminates artifact conflicts.