1.6 KiB
1.6 KiB
description
| description |
|---|
| Initialize a new Python project with modern tooling (uv, ruff, pytest) |
Initialize Python Project
Initialize a new Python project following modern best practices. This command sets up the project structure, tooling, and configuration.
Tasks to Complete
-
Project Initialization
- Run
uv init <project-name>to create the project - Create
.python-versionfile for pyenv compatibility - Initialize git repository if not already present
- Run
-
Directory Structure
- Create
src/<project_name>/for main code - Create
tests/directory for test files - Create
.vscode/for editor configuration - Create
docs/for documentation
- Create
-
Essential Dependencies
- Add
pytestas dev dependency:uv add --dev pytest - Add
ruffas dev dependency:uv add --dev ruff - Add
mypyas dev dependency:uv add --dev mypy - Add
pydanticas runtime dependency:uv add pydantic
- Add
-
Configuration Files
- Create
pyproject.tomlwith ruff and pytest configuration - Create
.gitignorefor Python projects - Create
.vscode/settings.jsonwith Python and ruff settings
- Create
-
Documentation
- Create
README.mdwith project overview and setup instructions - Create initial documentation structure
- Create
Expected Outcome
A fully initialized Python project ready for development with:
- Modern package management (uv)
- Fast linting and formatting (ruff)
- Testing framework (pytest)
- Type checking (mypy)
- Editor configuration (VSCode)
- Version control (git)
User Inputs Required
- Project name
- Python version (default: latest stable)
- Whether to include FastAPI for API projects