dataqbs

If in doubt, delete the uv.lock file

· Source: Simon Willison

The author notes that since starting to use Python 3.15, they have encountered intermittent errors related to dependencies. Their adopted solution is to delete the uv.lock file whenever a doubt arises. In library projects, this file is normally omitted because pinning specific versions can interfere with downstream consumers. However, when running commands such as uv run pytest, the UV manager automatically generates an uv.lock that remains in the directory, and because it is listed in .gitignore, it is not versioned.

The issue surfaces when the lock contains a dependency version that has not yet released a wheel compatible with Python 3.15. A recent example shows the watchfiles 1.1.1 library attempting to compile with PyO3, whose maximum supported Python version is 3.14, leading to a build failure. By deleting the uv.lock and re‑running the test, UV re‑resolves dependencies and selects versions that work with the current interpreter.

This practice is valuable because it prevents disruptions in development and automated testing workflows, ensuring that CI/CD environments update to compatible versions without extensive manual changes to lock files. It also helps maintain consistency between Python versions and packages, which is critical for the stability of projects migrating to newer language releases.

Read the original article on Simon Willison

This summary is an informational synthesis produced by dataqbs.com. All rights to the original content belong to its author and the cited media outlet. We act solely as curators of technology news and claim no authorship.

Read this in Español · Deutsch