Skip to content

Commit b7b4b4a

Browse files
chore(python): migrate to uv (#735)
1 parent c3907e4 commit b7b4b4a

4 files changed

Lines changed: 755 additions & 3 deletions

File tree

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ formats: all
2727

2828
python:
2929
install:
30-
- method: pip
31-
path: ./docs
30+
- method: uv
31+
command: sync

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,34 @@ No one knows your code as well as you do, so you are the best person to write th
154154
We understand that not everyone may be experienced with writing tests, so please reach out if you would like some
155155
assistance.
156156

157+
#### Python Projects
158+
All Python projects in the LizardByte organization use [uv](https://docs.astral.sh/uv/) for dependency management,
159+
Python environment setup, lock files, and command execution. A Python project's `pyproject.toml` and `uv.lock` files
160+
are the source of truth for its dependencies.
161+
162+
Use the Python version declared by the project instead of assuming the same version across every repository. After
163+
changing Python dependencies or project metadata, update and commit the lock file with the related change.
164+
165+
Common uv commands:
166+
167+
```shell
168+
uv lock --check
169+
uv sync --frozen
170+
uv run --locked python -m pytest
171+
uv lock
172+
```
173+
174+
Useful tips:
175+
176+
* Use `uv lock --check` in validation to confirm the lock file still matches `pyproject.toml`.
177+
* Use `uv sync --frozen` in custom build or CI commands to install only from `uv.lock` without updating it.
178+
* Use native uv integrations for hosted services when available, and add a lockfile drift check when they cannot pass
179+
`--frozen` directly.
180+
* Use `uv run --locked <command>` when you want to run a project command without changing `uv.lock`.
181+
* Use `uv sync --locked` locally when you want uv to fail if `uv.lock` is missing or out of date.
182+
* Use `uv lock` only when dependency inputs changed and the lock file should be updated.
183+
* Prefer project-specific commands from each repository's documentation when they exist.
184+
157185
### Localization
158186
LizardByte projects are used by people all over the world. When feasible, we strive to make our projects
159187
multilingual. If you are able to contribute translations, we would be grateful for your help.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "LizardByte"
7-
dynamic = ["version"]
7+
version = "0.0.0"
88
description = "LizardByte org level documentation"
99
requires-python = ">=3.14"
1010
license = {text = "AGPL-3.0-only"}
@@ -21,6 +21,9 @@ dependencies = [
2121
"sphinx-copybutton==0.5.2",
2222
]
2323

24+
[tool.uv]
25+
package = false
26+
2427
[project.urls]
2528
Homepage = "https://github.com/LizardByte"
2629
Repository = "https://github.com/LizardByte/.github"

0 commit comments

Comments
 (0)