Skip to content

Commit a1d5d4c

Browse files
authored
build: limit sdist contents to source and metadata files (#65)
## Summary Mirrors apify/crawlee-python#1890. The latest crawlee-python beta release failed when uploading the sdist: ``` 400 Bad Request — Project size too large. Limit for project 'crawlee' total size is 10 GB. ``` `pyproject.toml` only 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 only `src/apify_shared` and standard metadata files (`CHANGELOG.md`, `CONTRIBUTING.md`, `LICENSE`, `README.md`, `pyproject.toml`). Verified locally: built sdist is ~17 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](https://docs.pypi.org/project-management/storage-limits#requesting-a-project-size-limit-increase) once a project hits its quota. This PR just keeps future releases from chewing through quota.
1 parent 4c8aa0c commit a1d5d4c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ dev = [
5656
"ty~=0.0.0",
5757
]
5858

59+
[tool.hatch.build.targets.sdist]
60+
only-include = [
61+
"src/apify_shared",
62+
"CHANGELOG.md",
63+
"CONTRIBUTING.md",
64+
"LICENSE",
65+
"README.md",
66+
"pyproject.toml",
67+
]
68+
5969
[tool.ruff]
6070
line-length = 120
6171
include = ["src/**/*.py", "tests/**/*.py"]

0 commit comments

Comments
 (0)