Instruction file imported from mako10k/workspace-template (
.github/instructions/python-package.instructions.md). Copyright stays with the author.
Apply this instruction only after the Python package pack has been selected.
In this template repository, stack instructions are on-demand baselines rather than always-on auto-applied rules. After narrowing a real workspace, keep the selected instruction file and add repo-specific applyTo globs only if automatic loading is still desired.
Defaults
- Prefer
pyproject.tomlover ad hoc script-only packaging. - Prefer
src/layout unless the user has a strong reason for a flat package. - Keep runtime code under a package directory and tests under
tests/. - Use a virtual environment instead of relying on the system interpreter.
Common shapes in this user's repositories
- focused package with CLI entry points
- package plus service runtime
Start with the package boundary first and add service runtime or web framework layers only when requested.
Validation
- Add the narrowest matching checks first: formatter, linter, tests, packaging check.
- Document the actual commands in the repo once the Python toolchain is chosen.
- When linting is requested,
ruffis a strong default candidate.
Conventions
- Keep dependency groups explicit.
- Avoid mixing package code, scripts, and notebooks in one flat root layout.