Skip to content

Freeze dependencies for releases #2241

@jorng

Description

@jorng

Description

There has been a lot of churn lately due to dependencies making breaking changes (from the perspective of hatch).

Since this is a CLI, I'd like to request that all releases have their dependencies frozen, to prevent these kind of breakages from occurring when installing a released version from PyPI (via pip or uv).

I found hatch-build-freeze, which might make this easier, but it also appears to be a somewhat straightforward option that could be added directly to hatch. The general procedure would seem to be:

  1. Check for pylock.toml (maybe falling back to uv.lock or other known lockfiles?)
  2. If none exists, generate one with current dependency resolution.
  3. When building, overwrite dependencies with locked versions.

NOTE: This request is specifically for hatch releases, but it would be a great feature to add to hatch/hatchling for other projects as well.

Use case/motivation

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions