Skip to content

Commit 55d3ed3

Browse files
committed
Update contribution guide to include uv guideline
Signed-off-by: Charlie Truong <[email protected]>
1 parent fc312a8 commit 55d3ed3

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@
44

55
Use [abseil-py](https://github.com/abseil/abseil-py/tree/main)'s **logging**, **testing** and **flags** instead of Python's own **logging**, **unittest** and **argparse**.
66

7+
We use [uv](https://docs.astral.sh/uv/) for managing dependencies. For reproducible builds, our project tracks the generated `uv.lock` file in the repository.
8+
On a weekly basis, the CI attemps an update of the lock file to test against upstream dependencies.
9+
10+
New required dependencies can be added by `uv add $DEPENDENCY`.
11+
12+
New optional dependencies can be added by `uv add --optional --extra $EXTRA $DEPENDENCY`.
13+
14+
`EXTRA` refers to the subgroup of extra-dependencies to which you're adding the new dependency.
15+
Example: For adding a TRT-LLM specific dependency, run `uv add --optional --extra trtllm $DEPENDENCY`.
16+
17+
New dependencies to a dependency group can be added with `uv add --group $GROUP $DEPENDENCY`. Dependency groups are specific to uv and are also optional dependencies but not intended to be used with the package such as docs dependencies.
18+
19+
Alternatively, the `pyproject.toml` file can also be modified directly.
20+
21+
Adding a new dependency will update UV's lock-file. Please check this into your branch:
22+
23+
```bash
24+
git add uv.lock pyproject.toml
25+
git commit -m "build: Adding dependencies"
26+
git push
27+
```
28+
29+
### 🧹 Linting and Formatting
30+
31+
We use [ruff](https://docs.astral.sh/ruff/) for linting and formatting. CI does not auto-fix linting and formatting issues, but most issues can be fixed by running the following command:
32+
33+
```bash
34+
uv run ruff check --fix .
35+
uv run ruff format .
36+
```
37+
738
## Coding Style
839

940
We generally follow [Google's style guides](https://google.github.io/styleguide/) , with some exceptions:
@@ -16,7 +47,7 @@ We generally follow [Google's style guides](https://google.github.io/styleguide/
1647

1748
Although common, **mixed case is not allowed** in any code.
1849

19-
Run pre-commit at local before submitting merge request. You can also read [.pre-commit-config.yaml]( .pre-commit-config.yaml) to understand what are being forced. The **flake8** and **mypy** settings are inherited from PyTorch.
50+
Run pre-commit at local before submitting merge request. You can also read [.pre-commit-config.yaml]( .pre-commit-config.yaml) to understand what are being forced. The **flake8** and **mypy** settings are inherited from PyTorch.
2051

2152
## Test
2253

@@ -44,9 +75,9 @@ We use [abseil-py](https://github.com/abseil/abseil-py/tree/main) **testing** be
4475
```
4576
Developer Certificate of Origin
4677
Version 1.1
47-
78+
4879
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
49-
80+
5081
Everyone is permitted to copy and distribute verbatim copies of this
5182
license document, but changing it is not allowed.
5283

0 commit comments

Comments
 (0)