Skip to content

Commit f84ed93

Browse files
author
Jonathon Belotti
committed
make requirement.txt instructions more detailed
1 parent 41777ee commit f84ed93

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,34 @@ Contains Bazel rules to fetch and install Python dependencies from a requirement
44

55
## Usage
66

7-
In `requirements.txt`
7+
#### Setup `requirements.txt`
8+
9+
`rules_python_external` requires a _transitively-closed_ `requirements.txt` file, which would
10+
be very tedious to produce and maintain manually. To automate the process we recommend [`pip-compile` from `jazzband/pip-tools`](https://github.com/jazzband/pip-tools#example-usage-for-pip-compile).
11+
12+
For example, `pip-compile` takes a `requirements.in` like this:
13+
14+
```
15+
boto3~=1.9.227
16+
botocore~=1.12.247
17+
click~=7.0
18+
```
19+
20+
Can 'compiles' it so you get a transitively-closed `requirements.txt` like this, which should be passed to `pip_install` below:
21+
822
```
9-
cryptography==2.8
1023
boto3==1.9.253
24+
botocore==1.12.253
25+
click==7.0
26+
docutils==0.15.2 # via botocore
27+
jmespath==0.9.4 # via boto3, botocore
28+
python-dateutil==2.8.1 # via botocore
29+
s3transfer==0.2.1 # via boto3
30+
six==1.14.0 # via python-dateutil
31+
urllib3==1.25.8 # via botocore
1132
```
1233

13-
In `WORKSPACE`
34+
#### Setup `WORKSPACE`
1435

1536
```python
1637
rules_python_external_version = "{COMMIT_SHA}"

0 commit comments

Comments
 (0)