Skip to content

Commit fcfaaf6

Browse files
authored
Improve lockfile management documentation and enforce uv.lock freshness in CI (#3144)
1 parent a644d02 commit fcfaaf6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/python-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ jobs:
6565
enable-cache: true
6666
- name: Install system dependencies
6767
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos
68+
- name: Check uv.lock is up to date
69+
run: uv lock --check
6870
- name: Install
6971
run: make install
7072
- name: Run linters

mkdocs/docs/contributing.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,25 @@ For full control over your environment, you can use uv commands directly. See th
8888
- Managing dependencies with `uv add` and `uv remove`
8989
- Python version management with `uv python`
9090
- Running commands with `uv run`
91-
- Lock file management with `uv.lock`
91+
- Lock file management with `uv lock`
9292

9393
### Lock File Management
9494

95-
`uv.lock` is a cross-platform lockfile that contains exact information about the project's dependencies.
96-
See the [uv.lock documentation](https://docs.astral.sh/uv/guides/projects/#uvlock) for more details.
95+
`uv.lock` is a cross-platform lockfile that contains the exact versions of all project dependencies. See the [uv.lock documentation](https://docs.astral.sh/uv/guides/projects/#uvlock) for more details.
9796

98-
When modifying dependencies in `pyproject.toml`, regenerate the lock file:
97+
**Automatic lock file management:**
98+
When you commit changes to `pyproject.toml` or dependencies, the [`uv-pre-commit`](https://github.com/astral-sh/uv-pre-commit) pre-commit hook will automatically update `uv.lock` if needed. If the lockfile changes, your commit will be stopped and you will be prompted to add the updated `uv.lock` to your commit.
9999

100-
```bash
101-
make uv-lock
102-
```
103-
104-
Separately, to verify that the lock file is up to date without modifying it:
100+
**Manual update:**
101+
If you want to update the lockfile yourself (for example, after editing `pyproject.toml`), run:
105102

106103
```bash
107-
make uv-lock-check
104+
uv lock
108105
```
109106

107+
**CI enforcement:**
108+
Our continuous integration (CI) system checks that `uv.lock` is up to date with `pyproject.toml` on every pull request or push. If they are out of sync, the CI build will fail. This ensures that dependencies are always consistent and up to date for all contributors.
109+
110110
## Installation from source
111111

112112
Clone the repository for local development:

0 commit comments

Comments
 (0)