PyCon Portugal 2025

Tools to setup great Python projects: 2025 update
2025-07-24 , Auditorium

In 2023, I talked about my approach to setup reliable python projects, using tools to manage dependencies robustly and level up the team's code automatically. Since then, new tools have come out and my preferences have changed a bit:

  • Package manger: uv (previously: poetry)
  • Python manager: uv (previously: pyenv)
  • Python binaries manager: uv (previously: pipx)
  • Formatter: ruff + reorder-python-imports (previously: black + isort)
  • Linter: ruff
  • Tester: pytest

I still find it important to centralize your configurations and assure consistent behavior across CLIs, IDEs, CI/CDs, etc. I keep storing all configurations in pyproject.toml and setup a script that calls these tools (usually pre-commit).

Results:
- configure once, get helpful checks forever
- improve workflow for all team members, present and future
- deploy projects deterministically with little surprises
- consistent behavior across different environments


Summary

In 2023, I presented "How to setup great Python projects" in PyCon Portugal. I talked about my setup that brought some goodies to me and my team with little effort: good package management, automatic formatting, lint with auto-fixing, and others.

2 years later, I've changed my workflow to include recent tooling and I'm getting even better results, so I'd like to share my experience again.

Results:
- configure once, get helpful checks forever
- improve workflow for all team members (present and future)
- deploy projects deterministically with little surprises
- consistent behavior across different environments

Tools

Package/python/binaries manager

2025: uv
2023: poetry / pyenv / pipx

After creating the widely popular ruff, the code formatter and linter, astral created uv, a package manager with similar principles behind: speed and quality.

I like how fast it is, and how you can also manage python versions and standalone binaries with it.

My favorite features:
- good dependency solving and locking: makes deployments very deterministic
- speed: it's fast and pleasing to use
- batteries included: does what previously required 3 different tools
- backwards-compatibility with pip: I can immediately migrate projects that use pip and requirements.txt to uv

Formatters

2025: uv + reorder-python-imports
2023: black + isort

uv has introduced the option to format code, which is very similar to black and isort but much quicker, and will also allow linting code. So I'm using it and I'm quite happy.

reorder-python-imports first felt a bit strange, but has reduced the amount of git conflicts when different people change imports, so I'm fully onboard.

My favorite features of ruff:
- it's fast
- it also lints code

My favorite features of reorder-python-imports:
- it reduces git conflicts

Linters

2025: ruff
2023: ruff

I'm still using ruff: it was promising before, and it's the best nowadays.

My favorite features:
- it's fast
- it supports a lots of rules, and keeps growing
- it also formats code

Tester

2025: pytest
2023: pytest

I still find pytest a nice solution for tests, and more pythonic than the native unittest module.

My favorite features:

  • it's more pythonic than unittest
  • it allows re-usable fixtures and parametrization out of the box

Centralizing the configurations

  1. I store all configs in pyproject.toml, which is the default place for configuration nowadays.
  2. I write some script (Makefile, or pre-commit, or shell) to invoke the formatters, linters, etc WITHOUT any flag - (they will check pyproject.toml automatically)

The result:
- it's easy to apply the checks in the CLI (run the script)
- it's easy for IDEs to emit warnings and format on save (check pyproject.toml)
- it's easy for CI/CD processes to check PRs (run the script)

And all this happens consistently without drift across different processes!

Results

I find these to be the most important results:

  • configure once, get helpful checks forever
  • improve workflow for all team members (present and future)
  • deploy projects deterministically with little surprises
  • achieve consistent behavior across different environments

Audience Level

Intermediate

What are the main topics of your talk?

cicd devex devexp formatting linting packaging testing tools pytest ruff uv