| name | py-init |
| description | Bootstrap a new Python project with uv: pyproject.toml, ruff config, .python-version, and optional src layout. Use when starting a new Python package or script project. |
Task
Bootstrap a production-ready Python project named $ARGUMENTS using uv.
Steps
-
Create and enter the project directory (skip if already in it):
uv init $ARGUMENTS --no-readme
cd $ARGUMENTS
-
Configure pyproject.toml — ensure these sections exist (merge, don't overwrite):
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]
ignore = ["E501"]
[tool.ruff.format]
quote-style = "double"
[tool.pytest.ini_options]
testpaths = ["tests"]
-
Add dev dependencies:
uv add --dev ruff pytest
-
Create .python-version if missing (use the project's required version or default to 3.12).
-
Create tests/__init__.py and tests/test_placeholder.py with a single passing smoke test.
-
Run a quick sanity check:
uv run ruff check .
uv run pytest
Report what was created. If $ARGUMENTS is empty, apply the ruff/pytest config to the current directory instead.