chore: optimize package contents for distribution#9
Merged
Conversation
Configure hatchling to exclude unnecessary files from the source distribution (sdist). This reduces package size and ensures only essential files are distributed to users. Excluded from sdist: - .github/ - CI/CD workflows and GitHub-specific configs - tests/ - Test suite (not needed by end users) - CHANGELOG.md - Auto-generated, tracked in GitHub releases - AGENTS.md, CLAUDE.md - Developer documentation - release-please-config.json - Release automation config - .release-please-manifest.json - Release version tracking - renovate.json - Dependency update automation - uv.lock - Development lock file The wheel (binary) distribution already only includes the necessary Python code and is unchanged. Before: - sdist included ~15 files (tests, .github, configs, etc.) After: - sdist includes only 7 essential files (src/, LICENSE, README, pyproject.toml) - wheel unchanged (still optimal with just Python code) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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
Optimizes the Python package distribution by excluding unnecessary files from the source distribution (sdist). This ensures users only download what they need.
Problem
Currently, the sdist includes many files that aren't needed by end users:
.github/)tests/)AGENTS.md,CLAUDE.md)release-please-config.json,.release-please-manifest.json)renovate.json)uv.lock)CHANGELOG.md- tracked in GitHub releases)Solution
Added
[tool.hatch.build.targets.sdist]configuration topyproject.tomlto explicitly exclude these files.Changes
Before:
After:
What's Included Now
Source Distribution (sdist):
src/promptfoo/- Python source codeLICENSE- License fileREADME.md- User documentationpyproject.toml- Required for building from sourcePKG-INFO- Auto-generated package metadataWheel Distribution (unchanged):
promptfoo/- Compiled Python codepromptfoo-X.Y.Z.dist-info/- Package metadataBenefits
Testing
Built and verified both distributions:
Notes
.gitignoreis still included (minor, many projects include it)🤖 Generated with Claude Code