Python Packaging taste — ChatGPT & Claude.ai prompt: packaging rules
A prompt that hands the model a fixed set of Python packaging rules: pyproject.toml, src/, uv, Ruff. Useful when a new package needs one consistent style.
Open on GitHubWhat Python Packaging taste does
The prompt is a list of rules, each with a confidence score. The model takes them as instructions and answers along those lines: pyproject.toml instead of setup.py, a src/ layout, uv for installs, lockfiles and virtualenvs rather than pip and venv by hand.
Builds go through hatchling or another PEP 517 backend, and built wheels stay out of git. Ruff handles both formatting and linting, replacing Black and flake8. Types are checked with pyright or basedpyright in strict mode on the public API, and tests live in tests/ outside src/.
Releases get their own rules: publishing to PyPI through trusted publishing from GitHub Actions, versions pulled from git tags with hatch-vcs or setuptools-scm, twine check on artifacts before every release. The minimum Python version has to be stated explicitly, and CI should test the oldest supported one. This is a prompt, not a plugin — it runs nothing on its own and only steers what the model suggests. Paste it at the top of a ChatGPT or Claude.ai conversation and packaging advice stops drifting between a dozen approaches.
What it helps with
- drop
setup.pyfrom a new package and keep onepyproject.toml - fix tests that import an unpackaged tree
- move from pip and venv to uv with a lockfile
- replace Black and flake8 with Ruff alone
- publish to PyPI without long-lived API tokens
Example prompts for the agent
- Write a pyproject.toml for a new package following Python Packaging taste
- Check my project against these packaging rules and tell me what to change
- How do I set up trusted publishing from GitHub Actions to PyPI under these rules?
How to install Python Packaging taste
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Python Packaging taste
How do I install Python Packaging taste in Claude?
There is nothing to install: it is a prompt, so you copy it into the start of a conversation or into the system instructions.
What does Python Packaging taste do?
It gives the model a list of Python packaging rules: pyproject.toml, src/, uv, Ruff, pyright, trusted publishing. The model then answers within those rules.
How is it different from just asking for a package setup?
It fixes the tools and the directory layout up front, so the model does not propose a different stack each time. Every rule carries a confidence score.
Source text
prompts.csv · CC0-1.0
# Python Packaging taste - Use `pyproject.toml` as the single source of truth and drop `setup.py` for new packages. Confidence: 0.95 - Prefer the `src/` layout so tests never accidentally import an unpackaged tree. Confidence: 0.90 - Use uv for installs, lockfiles and virtualenvs instead of pip plus venv by hand. Confidence: 0.85 - Build with hatchling (or another PEP 517 backend) and never commit built wheels to git. Confidence: 0.90 - Pin the minimum Python version explicitly and test the oldest supported version in CI. Confidence: 0.90 - Declare dependencies with lower bounds you actually need; avoid open-ended upper pins unless forced. Confidence: 0.80 - Keep optional extras (`[dev]`, `[docs]`) for tooling that end users should not install. Confidence: 0.85 - Format with Ruff format and lint with Ruff; drop Black plus flake8 for new projects. Confidence: 0.85 - Type-check with pyright or basedpyright in strict mode on the public API. Confidence: 0.80 - Test with pytest and keep tests outside `src/` under `tests/`. Confidence: 0.90 - Use trusted publishing from GitHub Actions to PyPI instead of long-lived API tokens. Confidence: 0.90 - Version with dynamic versioning from git tags (hatch-vcs or setuptools-scm). Confidence: 0.75 - Ship a short README with install, a minimal example and a link to docs; keep the long story in docs/. Confidence: 0.90 - Include `py.typed` when you publish typed packages so consumers get inline types. Confidence: 0.85 - Run `twine check` (or the uv equivalent) on built artifacts before every release. Confidence: 0.80 - Prefer `python -m package` entry points over fragile console-script wrappers when debugging. Confidence: 0.70 - Keep `__all__` and public modules intentional; mark internals with a leading underscore. Confidence: 0.80
© f · CC0-1.0 · f/prompts.chat