build: limit sdist contents to source and metadata files#892
Merged
Conversation
Mirrors apify/crawlee-python#1890. Without an explicit sdist target, hatchling bundles the whole repo, ballooning the released sdist and risking exhaustion of PyPI's cumulative project size quota on beta releases.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #892 +/- ##
=======================================
Coverage 87.04% 87.04%
=======================================
Files 48 48
Lines 2942 2942
=======================================
Hits 2561 2561
Misses 381 381
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
janbuchar
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors apify/crawlee-python#1890.
The latest crawlee-python beta release failed when uploading the sdist:
pyproject.tomlonly configured the wheel target, so hatchling's default sdist bundled the entire repo. Each released sdist was much larger than the actual source. Combined with the fact that a beta release is published on every src-touching commit to master, the cumulative storage quota on PyPI hit the cap fast.This PR applies the same fix here: an explicit
[tool.hatch.build.targets.sdist]that ships onlysrc/apifyand standard metadata files (CHANGELOG.md,CONTRIBUTING.md,LICENSE,README.md,pyproject.toml). Verified locally: built sdist is ~96 KB and contains only those files.Tests are intentionally excluded — they need dev-only deps that aren't installable from a plain sdist anyway.
Note
PyPI's cap is cumulative across all uploaded files, so the eventual mitigation requires a project size limit increase once a project hits its quota. This PR just keeps future releases from chewing through quota.