Modern Python Project Setup with uv + Ruff in 2026

Modern Python Tools And Libraries May 13, 2026

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.

Share:
Last updated: May 2026
Built-in Functions in Python 2026 str() in Python 2026: String Conversion + Modern Formatting & Best Practices memoryview with JAX in Python 2026: Zero-Copy NumPy → JAX Array Interop + Efficient ML Examples memoryview with TensorFlow in Python 2026: Zero-Copy NumPy → Tensor Interop + GPU Pinning & ML Examples memoryview with TensorFlow in Python 2026: Zero-Copy NumPy → Tensor Interop + ML Examples memoryview with NumPy & PyTorch in Python 2026: Zero-Copy Views, Efficient Slicing & ML Interop Examples memoryview with NumPy in Python 2026: Zero-Copy Views, Efficient Slicing & Real ML Examples memoryview() in Python 2026: Zero-Copy Magic for Large Binary Data + Real Examples import() in Python 2026: How It Works, Security Risks & Modern Alternatives (importlib) zip() in Python 2026: How to Use It, strict=True Behavior & Real-World Examples vars() in Python 2026: Accessing Object Namespace + Modern Introspection Patterns type() in Python 2026: Dynamic Type Inspection & Object Creation + Modern Patterns tuple() in Python 2026: Immutable Sequences + Modern Patterns & Best Practices super() in Python 2026: Method Resolution & Modern Inheritance Patterns sum() in Python 2026: Summing Iterables + Modern Numeric Patterns & Best Practices staticmethod() in Python 2026: Static Methods, Utility Functions & Modern Best Practices sorted() in Python 2026: Sorting Iterables + Modern Patterns & Best Practices slice() in Python 2026: Creating Slice Objects + Modern Patterns & Best Practices setattr() in Python 2026: Dynamic Attribute Setting + Modern Patterns & Safety set() in Python 2026: Mutable Sets Creation + Modern Patterns & Best Practices