Modern Python Project Setup with uv + Ruff in 2026 — Stop wasting time managing virtual environments, dependencies, linting, and formatting. In 2026, the entire Python community has converged on one ultra-fast workflow: uv for project & package management + Ruff for linting & formatting.
This guide shows you exactly how to set up a clean, professional, production-ready Python project in under 2 minutes — the way top developers do it in 2026.
1. Install uv (One Command)
# Install uv (works on macOS, Linux, Windows)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Verify installation
uv --version
2. Create a New Project (Instant)
uv init my-awesome-project --python 3.13
cd my-awesome-project
This creates a perfect starter with pyproject.toml, README.md, and .python-version.
3. Add Core Dependencies
# Production dependencies
uv add polars fastapi pydantic httpx loguru pendulum
# Development tools
uv add --dev ruff pytest pytest-asyncio pre-commit
4. Recommended pyproject.toml (2026 Best Practices)
[project]
name = "my-awesome-project"
version = "0.1.0"
description = "A modern Python project"
requires-python = ">=3.12"
dependencies = []
[tool.uv]
dev-dependencies = []
[tool.ruff]
line-length = 88
target-version = "py313"
[tool.ruff.lint]
select = [
"E", "F", "I", "B", "UP", "RUF", "C4", "SIM", "PL"
]
ignore = ["E501"]
fix = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
[tool.pytest.ini_options]
pythonpath = ["."]
5. Daily Workflow Commands
# Sync environment (installs everything from pyproject.toml + uv.lock)
uv sync
# Run your app
uv run main.py
# Lint & auto-fix
uv run ruff check . --fix
# Format code
uv run ruff format .
# Run tests
uv run pytest
# Add new package later
uv add rich
uv add --dev typer
6. Bonus: Pre-commit Hooks (Highly Recommended)
uv add --dev pre-commit
uv run pre-commit install
Create .pre-commit-config.yaml with Ruff hooks.
7. Project Structure (Recommended)
my-awesome-project/
├── pyproject.toml
├── uv.lock
├── README.md
├── .python-version
├── src/
│ └── my_awesome_project/
│ ├── __init__.py
│ └── main.py
├── tests/
│ └── test_main.py
└── .gitignore
Conclusion: Your 2026 Productivity Boost
With uv + Ruff you now have:
- 10–100x faster dependency management
- Instant project creation
- Perfect reproducibility via
uv.lock - Blazing-fast linting & formatting
- One tool for everything
Commit pyproject.toml and uv.lock to Git — your entire team (and CI/CD) will thank you.
Start your next project today with this modern setup and feel the difference immediately!
💡 Pro Tip: Create a GitHub template repository with this exact setup so every new project starts perfectly configured.