Skip to content

Commit 4bcc29c

Browse files
committed
Fix PyPI publishing: remove non-package files from dist/
- Add cleanup step before PyPI upload to remove files that aren't .whl or .tar.gz - Fixes: InvalidDistribution error for build-info.txt and other non-package artifacts - PyPI only accepts wheel and source distribution files
1 parent f366264 commit 4bcc29c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,16 @@ jobs:
578578
echo ""
579579
echo "Total PyPI artifacts: $(find dist -type f \( -name "*.whl" -o -name "*.tar.gz" \) | wc -l)"
580580
581+
- name: Clean non-package files from dist/
582+
run: |
583+
echo "==> Removing non-package files from dist/ before PyPI upload..."
584+
find dist/ -type f ! \( -name "*.whl" -o -name "*.tar.gz" \) -delete
585+
echo ""
586+
echo "Remaining files for PyPI:"
587+
ls -la dist/
588+
echo ""
589+
echo "Total PyPI artifacts: $(find dist -type f \( -name "*.whl" -o -name "*.tar.gz" \) | wc -l)"
590+
581591
- name: Publish to PyPI
582592
uses: pypa/gh-action-pypi-publish@release/v1
583593
with:

0 commit comments

Comments
 (0)