Skip to main content
prompt GP ChatGPT

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 GitHub

What 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.py from a new package and keep one pyproject.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

Questions 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

Similar prompts

All prompts for Programming languages →

From the same set77

The whole set →
Monorepo taste A prompt that hands the agent a fixed set of monorepo conventions: pnpm workspaces, Turborepo, package boundaries and shared configs. Useful when repo structure keeps drifting. GP ChatGPT ★ 174,597repo stars Rust CLI taste A prompt that tells the model how to write a Rust command-line tool: argument parsing, error handling, output streams, tests. GP ChatGPT ★ 174,597repo stars React State Management taste A ruleset for picking React state tools: when to use useState, Zustand, Context and TanStack Query. Helps avoid overbuilt global stores and duplicated state. GP ChatGPT ★ 174,597repo stars Observability taste A prompt that tells an AI assistant how to wire traces, metrics and logs into a service. Handy when you ask a model to write instrumented code. GP ChatGPT ★ 174,597repo stars Open Source Release Checklist Builder (YAML) This prompt turns an upcoming open-source release into a YAML checklist for versions, tests, artifacts, security notes, rollback, and announcements. GP ChatGPT ★ 174,597repo stars Dockerfile and CI taste A prompt that lists rules for Dockerfiles and CI: multi-stage builds, non-root user, image scanning. Useful when you ask an AI to write or review a build config. GP ChatGPT ★ 174,597repo stars Senior Code Reviewer (severity-ranked) A code review prompt that ranks findings from blockers down to nits and closes with a verdict. Useful when you need to know what in a patch actually breaks. GP ChatGPT ★ 174,597repo stars TypeScript Library taste A prompt that pins down conventions for a TypeScript library: pnpm, strict tsconfig, tsup, vitest, Changesets. Useful when a project needs one style from the first commit. GP ChatGPT ★ 174,597repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor