Skip to content

chore: exclude .python-version from package distribution#11

Merged
mldangelo merged 1 commit intomainfrom
chore/exclude-python-version
Jan 6, 2026
Merged

chore: exclude .python-version from package distribution#11
mldangelo merged 1 commit intomainfrom
chore/exclude-python-version

Conversation

@mldangelo
Copy link
Copy Markdown
Member

Summary

Excludes .python-version from the package source distribution. This file is used by pyenv and other version managers for local development but shouldn't be distributed to end users.

Problem

Testing PyPI 0.1.1 revealed that .python-version was still being included in the source distribution:

promptfoo-0.1.1/.python-version  ❌
promptfoo-0.1.1/src/promptfoo/__init__.py
promptfoo-0.1.1/src/promptfoo/cli.py
...

Solution

Add /.python-version to the [tool.hatch.build.targets.sdist] exclude list.

Verification

$ uv build
$ tar -tzf dist/promptfoo-0.1.1.tar.gz | grep "\.python-version"
# No output ✅ Successfully excluded

$ tar -tzf dist/promptfoo-0.1.1.tar.gz
promptfoo-0.1.1/.gitignore
promptfoo-0.1.1/LICENSE
promptfoo-0.1.1/PKG-INFO
promptfoo-0.1.1/pyproject.toml
promptfoo-0.1.1/README.md
promptfoo-0.1.1/src/promptfoo/__init__.py
promptfoo-0.1.1/src/promptfoo/cli.py

Only essential files remain ✅

Impact

  • Users: Will no longer receive .python-version when installing from source
  • Distribution size: Negligible reduction (tiny file)
  • Package quality: Cleaner, more professional distribution

🤖 Generated with Claude Code

Add .python-version to the sdist exclusion list. This file is used by
tools like pyenv for local development but should not be distributed
to end users.

Analysis of PyPI 0.1.1 package showed .python-version was included in
the source distribution. This change removes it from future releases.

Package contents verification:
- ✅ .python-version successfully excluded
- ✅ Only essential files remain (src/, LICENSE, README, pyproject.toml, .gitignore)
- ✅ Wheel distribution unchanged (already optimal)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mldangelo mldangelo merged commit 4f244be into main Jan 6, 2026
9 checks passed
@mldangelo mldangelo deleted the chore/exclude-python-version branch February 24, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant