Skip to content

Commit 815164a

Browse files
authored
📚 Docs for updating requirements (#281)
1 parent f74f2e7 commit 815164a

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

‎src/BUILD‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ py_library(
5353
visibility = ["//visibility:public"],
5454
)
5555

56-
# In order to update the requirements, change the `requirements.txt` file and run:
57-
# `bazel run //src:requirements`.
58-
# This will update the `requirements_lock.txt` file.
56+
# In order to update the requirements, change the `requirements.in` file and run:
57+
# `bazel run //src:requirements.update`.
58+
# This will update the `requirements.txt` file.
5959
# To upgrade all dependencies to their latest versions, run:
60-
# `bazel run //src:requirements -- --upgrade`.
60+
# `bazel run //src:requirements.update -- --upgrade`.
6161
compile_pip_requirements(
6262
name = "requirements",
6363
srcs = [

‎src/README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ Find everything related to testing and how to add your on test suite [here](/too
8080

8181
> If you want to develop your own sphinx extension, check out the [extensions guide](/src/extensions/README.md)
8282
83+
## Updating dependencies
84+
85+
The file [requirements.in](./requirements.in) is a [PIP requirements file](https://pip.pypa.io/en/stable/reference/requirements-file-format/) that describe first level dependencies.
86+
87+
The file [requirements.txt](./requirements.txt) is a [pip-compile lock file](https://pip-tools.readthedocs.io/en/latest/cli/pip-compile/) that holds
88+
the pinned dependency tree calculated from [requirements.in](./requirements.in).
89+
90+
To update dependencies (e.g. after adding a dependency), run:
91+
```
92+
bazel run //src:requirements.update
93+
```
94+
95+
To update the full dependency tree, run
96+
```
97+
bazel run //src:requirements.update -- --upgrade
98+
```
99+
83100
## Best Practices
84101

85102
1. **Documentation**

0 commit comments

Comments
 (0)