A few months ago, I wrote about venturing into Python territory as a Node.js developer. That post was about culture shock — learning requirements.txt, virtual environments, and the Python "trinity" of Black, Flake8, and MyPy. This is the sequel. I've shipped multiple Python projects since then, and my setup has evolved dramatically.
Spoiler: I don't use requirements.txt anymore. Or Black. Or Flake8. Here's what changed.
The Old Way vs. The New Way
Remember my original setup?
Now? A single command:
That's it. One tool. One command. Everything just works.
uv: The Package Manager That Changed Everything
If you've used Bun in Node.js, uv is the equivalent for Python — same speed improvement, same simplicity.
Here's my actual setup from a recent project:
No more requirements.txt. No more requirements-dev.txt. Everything lives in pyproject.toml—just like package.json in Node.js, but better structured.
The [dependency-groups] feature is well-designed. Development dependencies stay separate from production, but they're all in one file. When I run uv sync, it sets up everything. When I deploy, I can exclude dev dependencies.
Ruff: One Tool to Rule Them All
Remember the "Python Development Trinity" I mentioned before—Black, Flake8, and MyPy? I've collapsed two of those into one:
Ruff does what Black + Flake8 + isort did, but in a single tool that's written in Rust and runs in milliseconds. My entire codebase lints in the time it took Flake8 to start up.
Ruff's select system lets me pick exactly which rules I want. I'm not stuck with a monolithic configuration—I can enable flake8-bugbear for catching common bugs, flake8-simplify for code simplification suggestions, and pyupgrade for automatically modernizing my code.
Pydantic: TypeScript-Level Confidence
Coming from TypeScript, I missed knowing data shapes at compile time. Pydantic gives me that in Python:
This isn't just type hints—it's runtime validation with clear error messages. The Annotated[int, Field(ge=1)] ensures the value is at least 1. The @model_validator handles cross-field validation that TypeScript's type system can't express.
And frozen=True? That makes the model immutable after creation. No accidental mutations. No debugging weird state changes.
Typer + Rich: Beautiful CLIs Without the Boilerplate
CLI tools in Python used to mean argparse. Typer with Rich is a significant improvement:
Type hints become CLI arguments. Help text is generated automatically. Validation happens for free (min=1 ensures positive values). Rich gives me colors and formatting without any extra work.
Less code than Click or argparse, with better output.
My Modern Python Project Structure
My current project structure:
It's feature-based, like my Vue/React projects. Each feature owns its domain. Tests mirror the source structure. Everything is discoverable.
The Makefile: npm Scripts for Python
I still use a Makefile for common tasks—it's the npm scripts of Python:
uv run is the magic here. It automatically uses the project's virtual environment without me having to activate it. Just like npx or bunx, but smarter.
Testing: pytest + pytest-asyncio
Async testing with pytest-asyncio:
Pydantic validation errors tell you exactly what went wrong and where.
What I Actually Build Now
Let me show you a real async function from production:
Type hints everywhere. Clean separation. Reads almost like TypeScript.
The Confidence Boost
Here's what strict typing and Pydantic validation give me:
With strict = true, MyPy catches most issues. Combined with Pydantic's runtime validation, bugs fail at import time or during validation — not in production.
The Evolution Summary
| Before | After |
|---|---|
requirements.txt + requirements-dev.txt | pyproject.toml with [dependency-groups] |
pip install + manual venv | uv sync |
| Black + Flake8 + isort | Ruff (all-in-one, Rust-powered) |
| argparse / Click | Typer + Rich |
| Manual validation | Pydantic with @model_validator |
Makefiles with source venv/bin/activate | Makefiles with uv run |
What's Next
Modern Python with type hints, Pydantic, and uv is a different experience from the legacy tutorials. The ecosystem has matured.
Start with uv init, add dependencies to pyproject.toml, and let Ruff handle the rest.