Skip to content

Don't pin dependency versions in pyproject.toml #1665

Description

@liberforce

Hey, nice to see you finally switched to uv 👍 .

I saw you're taking a very conservative approach though: each revision is pinned in the pyproject.toml (i.e. uses strict equality comparison operator "=="). This means that people can't adjust it to their environment, or create an environment where they can install other packages that may lead to conflicts in the revisions accepted.

The uv dependency solver is supposed to choose the best dependency versions based on the hints in the pyproject.toml. Strict use of very specific revisions though, is the job of the dependency locking process, which you run with uv lock. This is what guarantees the versions people get at uv sync time.

There's also the fact that this doesn't allow upgrading packages easily for bug fixes, security fixes, or new features (like changes in ruff default rules for example).

So: don't pin, use >=, or ~= operators instead. The lock file already guarantees people will get the exact revisions you use, just don't force it on them if they have different usage patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions