A modern Python project template with best practices and cutting-edge tooling.
- 📦 uv for fast, reliable package management
- 🏗️ Source layout with
src/{library-name}structure - 🧪 pytest for comprehensive testing
- 🎨 ruff for lightning-fast linting and formatting
- 🔍 deptry for dependency analysis and unused dependency detection
- ⚡ PoeThePoet for task automation
- 🤖 GitHub Actions with PR welcome messages and slash command support
- 📋 Dedicated config files instead of cramming everything into pyproject.toml
-
Clone and setup:
git clone <your-repo> cd <your-repo> uv sync --extra dev
-
Run tasks with poe:
# List all available tasks uv run poe # Run tests uv run poe test # Format and lint code uv run poe format uv run poe lint # Run all checks uv run poe check
poe test- Run all testspoe test-fast- Run tests with fast exit on first failurepoe test-cov- Run tests with coverage reportingpoe lint- Check code style and qualitypoe format- Format code with ruffpoe format-check- Check if code is properly formattedpoe deps- Check for unused and missing dependencies
poe check- Run format check, linting, dependency check, and testspoe fix- Auto-format and fix linting issuespoe pre-commit- Run pre-commit style checks
poe install- Install with development dependenciespoe install-prod- Install production dependencies onlypoe build- Build the package
poe clean- Clean up build artifacts and cachepoe version- Show package versionpoe docs- Generate documentation (placeholder)poe typecheck- Run type checking (placeholder)poe security- Run security checks (placeholder)
When you open a pull request, you'll automatically get a welcome message with helpful commands.
Use /poe <task-name> in PR comments to run tasks:
/poe test- Run tests/poe lint- Check code quality/poe format- Format code/poe check- Run all checks
Note: For security reasons, slash commands run against the base repository code, not the PR changes. This ensures that untrusted code cannot be executed in a privileged environment.
awesome-python-template/
├── src/
│ └── awesome_python_template/ # Main source code
│ ├── __init__.py
│ └── py.typed
├── tests/ # Test files
│ ├── __init__.py
│ └── test_awesome_python_template.py
├── .github/
│ └── workflows/ # GitHub Actions
│ ├── pr-welcome.yml
│ └── slash-command-dispatch.yml
├── pyproject.toml # Project metadata and minimal config
├── ruff.toml # Ruff configuration
├── pytest.ini # Pytest configuration
├── poe_tasks.toml # PoeThePoet task definitions (reference)
├── uv.lock # Dependency lock file
└── README.md # This file
This template uses dedicated configuration files for each tool:
ruff.toml- Ruff linting and formatting configurationpytest.ini- Pytest testing configurationpyproject.toml- Minimal project metadata and poe taskspoe_tasks.toml- Reference copy of task definitions
Tests are organized with pytest markers:
@pytest.mark.unit- Unit tests@pytest.mark.integration- Integration tests
Run specific test types:
uv run poe test-unit # Unit tests only
uv run poe test-integration # Integration tests onlyDevelopment dependencies are defined in pyproject.toml:
- pytest - Testing framework
- pytest-cov - Coverage reporting
- ruff - Linting and formatting
- deptry - Dependency analysis
- poethepoet - Task runner
This template includes deptry for detecting unused and missing dependencies. To ignore false positives, search for "deptry" in the repository and update the configuration in pyproject.toml:
[tool.deptry]
# To ignore specific error codes globally:
ignore = ["DEP004"] # Example: ignore misplaced dev dependencies
# To ignore specific packages, use CLI options in poe tasks:
# poe deps --per-rule-ignores DEP002=package-nameThis template follows modern Python best practices:
- Source layout - Code in
src/directory - Dependency management - uv for fast, reliable installs
- Code quality - Ruff for consistent formatting and linting
- Testing - Comprehensive pytest setup with coverage
- Task automation - PoeThePoet for development workflows
- CI/CD - GitHub Actions with PR automation
- Configuration - Dedicated files for each tool
- Make your changes
- Run
uv run poe fixto auto-format and fix linting - Run
uv run poe testto ensure tests pass - Push your changes
- Use
/poe <task>commands in PR comments as needed
Contributions are welcome! See CONTRIBUTING.md for setup and development guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.