来源时间 本站刊期
行业动态Simon Willison
If in doubt, delete the uv.lock file
Following Simon Willison's advice to delete uv.lock trades reproducible builds for a faster fix, a cost each project team must weigh before clearing its lockfile.
判断
Library maintainers and CI owners on Python 3.15 must choose whether to delete a stray uv.lock to clear a PyO3 build failure, accepting that the next run may resolve different dependency versions.
依据
Simon Willison writes that since switching to Python 3.15 he gets occasional confusing Python dependency errors, and his rule is: “If in doubt, delete the uv.lock file.” Most of his projects are libraries that do not include a uv.lock, because locking versions for downstream users would be rude. Running uv run pytest can leave uv.lock files that are listed in .gitignore and not committed. Sometimes that lock pins a dependency without a Python 3.15 wheel; his example is error: Failed to build watchfiles==1.1.1, with maturin.build_wheel failing because the configured Python interpreter version (3.15) is newer than PyO3’s maximum supported version (3.14). Deleting the file and running uv run pytest again usually fixes it. Mechanism: the stale lock can hold an incompatible pin, so clearing it lets uv re-resolve and attempt a build under 3.15.
- Delete uv.lockthen
- uv run pytestusually fixes
- Dependency builds
没写清 The source does not say whether deleting uv.lock changes committed constraints or how often the fix fails.
下一步 Re-run uv run pytest after deleting uv.lock and check whether watchfiles==1.1.1 still fails under Python 3.15.