Working on several projects at once quickly teaches you one thing: sometimes the biggest problem is not the code itself. Environments, library versions, quality rules and the different ways of working with each repository can demand just as much attention. That is why good tooling should bring order to these things, not add yet another layer to remember. And it is from this perspective that uv and Ruff are looking more and more interesting.
A project is more than code
Code is, of course, the most important part of any software project, but it does not live in a vacuum. Alongside it we have the language version, external libraries, the runtime environment, the way dependencies are installed, quality tooling and the conventions agreed within the team.
The more people and projects show up in day-to-day work, the clearer it becomes that this knowledge should not live only in a developer’s head. The project itself should state, as clearly as possible, how to work with it, what it requires and which rules apply. Coming back to a repository after a few months should not start with recalling its entire technical surroundings and re-making decisions that were already made once.
For us, this approach is part of project quality. It is not only about whether the code works today, but also whether in six months it can still be run predictably, developed further and handed over to someone else without reconstructing knowledge from terminal history, the README and the team’s memory.
Quality a human shouldn’t have to police
If a project is more than just code, the natural next step is to bring order to what happens around it as well. Many quality rules are repetitive and can be checked unambiguously: formatting, import order, unused variables, suspicious constructs or how functions are documented.
We have long used tools that let us write such rules down and enforce them automatically. Black takes care of formatting, isort sorts imports, Pylint or Flake8 analyse the code, and pre-commit ties the checks together and runs them before a change ever reaches the remote repository.
As a result, the rules stop being merely an agreement within the team and become part of the project.
This also has a very practical effect. Code review can focus on logic, architecture, readability and edge cases instead of turning into a discussion about an unused import or the formatting of a few lines. If something can be checked unambiguously by a machine, there is little point in spending another person’s time on it.
In the classic approach, such a setup might look roughly like this:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: <version>
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: <version>
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: <version>
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: <version>
hooks:
- id: flake8And it works. Black formats the code, isort sorts the imports, Flake8 enforces the defined rules, and simpler hooks catch things like stray whitespace or broken configuration files. A commit can be stopped before a mistake ever leaves the local repository.
This approach served well for years and can still be a perfectly valid solution. The problem lies elsewhere: as the project grows, the quality-control machinery itself starts to consist of more and more parts. A separate formatter, a linter, an import tool, extra plugins and configurations, each with its own version, settings and scope of responsibility.
So if the goal of automation was to reduce the number of things a human has to keep an eye on, it is worth asking from time to time whether the tooling itself has started demanding too much attention.
Fewer things to keep an eye on
Of course, it can be simpler, and this is exactly where uv and Ruff come in.
The two tools cover different parts of a project, but they share a similar philosophy: reduce the number of separate pieces you have to configure, update and remember. Ruff takes care of code quality, while uv handles the environment, the Python version, dependencies and the way you work with the project.
In the previous section we showed how several tools can jointly guard code quality. The situation around simply running a project often looks similar: pip, venv, dependency files, an extra tool for Python versions, separate mechanisms for syncing the environment and more files for different project variants.
That is not to say any of these tools is bad. Quite the opposite: many of them solved specific problems very well for years. The question is rather whether we can describe the same responsibilities today in a simpler, more consistent way.
You can see this clearly in pyproject.toml, which can become one of the main places describing the project:
[project]
requires-python = ">=3.12,<3.13"
dependencies = [
"requests>=2.32,<3",
]
[dependency-groups]
dev = [
"pytest",
"ruff",
"pre-commit",
]
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "I"]In one place we see the Python version, the application’s requirements, the dependencies needed during development and some of the code-quality rules.
Ruff can take over linting, formatting, import sorting and part of the duties previously spread across several separate tools. That does not mean pre-commit is no longer needed: it can still be a great mechanism for enforcing checks before a commit. What changes is the number of pieces you have to maintain underneath it.
uv brings order to the other side of the project. It does not reduce library management to just installing packages. It manages the environment, the Python version, the dependencies and their exact resolution recorded in a lockfile.
This matters especially when a project cannot simply use any version of a library. In organisations, specific releases may have been tested beforehand, approved from a security standpoint, or required for compatibility with other parts of the system. Such constraints should be part of the project, not an agreement passed along from person to person.
For example:
[project]
dependencies = [
"pydantic>=2.11,<2.12",
"httpx>=0.27,<0.29",
]Declaring a version range is, of course, nothing new: similar control was possible before with requirements.txt or pyproject.toml. Things get interesting when we start looking at the whole dependency graph.
One library may require:
common-lib >=2.0,<4.0and another:
common-lib >=3.1,<3.5In this case there is an overlapping range, and the resolver can find a valid solution.
But if the requirements are:
common-lib >=4.0
common-lib <4.0no amount of manual experimenting with package installation will change the fact that the project has conflicting requirements.
Takeaway. It is not just about downloading libraries, but about finding a consistent set that satisfies every constraint we have accepted, or detecting as early as possible that no such set exists.
Once a solution is found, the exact state of the project can be recorded in uv.lock. pyproject.toml describes what the project requires and which ranges we accept, while the lockfile stores the result of resolving those requirements. Thanks to that, the next environment does not have to make the same decision from scratch.
This also shows in day-to-day work with the project. Instead of manually creating an environment, activating it, installing dependencies and only then running the application, you can run a command directly in the environment managed by uv:
uv run python main.pyThe same goes for the tools that are part of the project:
uv run pytest
uv run ruff check .Before running a command, uv makes sure the project environment exists and matches the declared dependencies. If the environment does not exist yet, it can be created automatically. There is no need to remember a separate sequence of creating a virtualenv, activating it and manually syncing packages before starting work.
This is not just about shortening a few commands. What matters more is that the way the project is run becomes predictable too. Someone who clones the repository a few months later does not have to reconstruct the right order of environment setup from the documentation: the project contains the information needed to do that work.
The same applies to different ways of working with one repository. A project may need a different set of libraries for development, testing or preparing a demo version:
[dependency-groups]
dev = [
"pytest",
"ruff",
]
demo = [
"faker",
"rich",
]The point is not just the convenience of having several groups. More importantly, this knowledge also becomes part of the project. Nobody has to remember that “for the demo we install three extra packages” or dig up the right instructions from a few months ago.
This is what we find most interesting about combining uv and Ruff. Not that they do more work for the developer, but that they let us make more decisions once, record them in the project and then enforce them consistently.
Fewer decisions to make twice
Ruff and uv are not the answer to every problem in a project, nor are they the only path to good-quality software. Ruff will not make architectural decisions for us, the resolver will not tell us whether upgrading a library makes business sense, and a lockfile will not replace tests.
And that is exactly the point.
In our work, we want people to make primarily the decisions that genuinely require their knowledge and judgement. Anything that is repetitive, unambiguous and can be written down as a rule is worth moving into the project itself as early as possible.
That is why we do not treat uv and Ruff as another technology fad or a mandatory tool swap just because something new has appeared. They are fast, written in Rust and technically very interesting, but that is not what matters most to us.
Far more important is that they fit well with the way we want to build and maintain projects: rules should be explicit, environments reproducible, dependency versions controlled, quality enforced automatically, and the number of things that depend solely on human memory as small as possible.
Tools will change. In a few years part of the current stack may look completely different, and that is natural. More important than attachment to any particular tool is the principle behind choosing it: if we can simplify the way we work without losing control or quality, it is worth doing.
Good tools should not demand more of our attention. They should work in the background and take care of the repetitive things, leaving people time for the problems that cannot be reduced to configuration, a linter rule or a lockfile.
Takeaway. Fewer tools in your head simply means more room for the project itself.