Python Project Init
Workflow
- Ensure uv is installed
command -v uv || curl -LsSf https://astral.sh/uv/install.sh | sh
If installed via the script, reload PATH:
source "$HOME/.local/bin/env"
- Scaffold the project
uv init <project-name>
Ask the user for the project name if not provided. After init, cd into the project directory for all subsequent steps.
- Add dev dependencies
uv add --dev pytest pytest-asyncio pytest-cov ruff ty
- Ensure just is installed
command -v just || cargo install just || brew install just
Prefer the package manager available on the system. On Linux without cargo/brew, use:
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to "$HOME/.local/bin"
- Create config files
Copy from assets/ into the project root:
-
ruff.toml — line length 100, target Python 3.13
-
ty.toml — Python 3.13 environment
-
pytest.ini — test discovery, coverage >= 85%, asyncio auto mode
- Create Justfile
Copy assets/Justfile into the project root.
- Verify
Run just in the project directory to confirm the Justfile is valid and commands are listed.