You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,37 @@
4
4
5
5
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**.
6
6
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
+
7
38
## Coding Style
8
39
9
40
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/
16
47
17
48
Although common, **mixed case is not allowed** in any code.
18
49
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.
20
51
21
52
## Test
22
53
@@ -44,9 +75,9 @@ We use [abseil-py](https://github.com/abseil/abseil-py/tree/main) **testing** be
44
75
```
45
76
Developer Certificate of Origin
46
77
Version 1.1
47
-
78
+
48
79
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
49
-
80
+
50
81
Everyone is permitted to copy and distribute verbatim copies of this
0 commit comments