uv.lock
A lock file generated by the uv tool that records the exact versions, source hashes and platform markers of all project dependencies. It is used to achieve reproducible installations.
Core Facts
Timeline (last 90 days)
The design of uv.lock is an advantage in application projects (ensuring reproducibility), but in library projects it causes a version-freezing effect, with side effects outweighing the benefits.
By convention, Python library projects should not include a uv.lock file, because pinning versions affects downstream projects; therefore a library project's uv.lock is usually written into .gitignore.
When running commands such as uv run pytest, uv automatically generates a uv.lock file if the lock file is missing.
The role of uv.lock is to precisely record the versions, source hashes, and platform markers of all direct and transitive dependencies of a project, so as to achieve reproducible installation across machines and over time.
In a library project, if uv.lock pins old dependency versions from before Python 3.15 support, deleting uv.lock causes uv to re-resolve dependencies and choose new versions that support Python 3.15, thereby resolving the build error.
When dependencies need to be reproduced precisely in a production environment, deleting the lock file may mask problems, and this rule does not apply.
Using lock files such as uv.lock can prevent unexpected changes introduced by automatic upgrades.
Lockfiles (such as pnpm-lock.yaml, package-lock.json, yarn.lock) record every dependency actually installed by the project and its exact version; when a direct dependency requires a higher version, the package manager will bump the lockfile entry, which may trigger synchronized changes in indirect dependencies.
uv.lock is a lock file generated by the Python package manager uv that precisely records the specific versions of all dependency packages in the current environment.
When the package version declared in pyproject.toml drifts from the record in the lock file, it may cause inconsistent behavior between local and CI environments.
1 more timeline events
All Facts (11)
Lockfiles (such as pnpm-lock.yaml, package-lock.json, yarn.lock) record every dependency actually installed by the project and its exact version; when a direct dependency requires a higher version, the package manager will bump the lockfile entry, which may trigger synchronized changes in indirect dependencies.
75%UnverifiedThe design of uv.lock is an advantage in application projects (ensuring reproducibility), but in library projects it causes a version-freezing effect, with side effects outweighing the benefits.
50%UnverifiedWhen running commands such as uv run pytest, uv automatically generates a uv.lock file if the lock file is missing.
50%UnverifiedThe role of uv.lock is to precisely record the versions, source hashes, and platform markers of all direct and transitive dependencies of a project, so as to achieve reproducible installation across machines and over time.
50%UnverifiedIn a library project, if uv.lock pins old dependency versions from before Python 3.15 support, deleting uv.lock causes uv to re-resolve dependencies and choose new versions that support Python 3.15, thereby resolving the build error.
50%UnverifiedWhen dependencies need to be reproduced precisely in a production environment, deleting the lock file may mask problems, and this rule does not apply.
50%UnverifiedBy convention, Python library projects should not include a uv.lock file, because pinning versions affects downstream projects; therefore a library project's uv.lock is usually written into .gitignore.
50%UnverifiedUsing lock files such as uv.lock can prevent unexpected changes introduced by automatic upgrades.
50%UnverifiedWhen the package version declared in pyproject.toml drifts from the record in the lock file, it may cause inconsistent behavior between local and CI environments.
50%Unverifieduv.lock is a lock file generated by the Python package manager uv that precisely records the specific versions of all dependency packages in the current environment.
50%Unverifiedv1.12.1 aligns the package version with the record in uv.lock, which is a normative correction for internal dependency management.
50%