@@ -20,12 +20,13 @@ load("//python/pip_install:requirements.bzl", _compile_pip_requirements = "compi
20
20
compile_pip_requirements = _compile_pip_requirements
21
21
package_annotation = _package_annotation
22
22
23
- def pip_install (requirements , name = "pip" , ** kwargs ):
23
+ def pip_install (requirements = None , name = "pip" , ** kwargs ):
24
24
"""Accepts a `requirements.txt` file and installs the dependencies listed within.
25
25
26
26
Those dependencies become available in a generated `requirements.bzl` file.
27
27
28
- This macro runs a repository rule that invokes `pip`. In your WORKSPACE file:
28
+ This macro wraps the [`pip_repository`](./pip_repository.md) rule that invokes `pip`.
29
+ In your WORKSPACE file:
29
30
30
31
```python
31
32
pip_install(
@@ -88,7 +89,7 @@ def pip_install(requirements, name = "pip", **kwargs):
88
89
Args:
89
90
requirements (Label): A 'requirements.txt' pip requirements file.
90
91
name (str, optional): A unique name for the created external repository (default 'pip').
91
- **kwargs (dict): Keyword arguments passed directly to the `pip_repository` repository rule.
92
+ **kwargs (dict): Additional arguments to the [ `pip_repository`](./pip_repository.md) repository rule.
92
93
"""
93
94
94
95
# Just in case our dependencies weren't already fetched
@@ -107,7 +108,8 @@ def pip_parse(requirements_lock, name = "pip_parsed_deps", **kwargs):
107
108
Those dependencies become available in a generated `requirements.bzl` file.
108
109
You can instead check this `requirements.bzl` file into your repo, see the "vendoring" section below.
109
110
110
- This macro runs a repository rule that invokes `pip`. In your WORKSPACE file:
111
+ This macro wraps the [`pip_repository`](./pip_repository.md) rule that invokes `pip`, with `incremental` set.
112
+ In your WORKSPACE file:
111
113
112
114
```python
113
115
load("@rules_python//python:pip.bzl", "pip_parse")
@@ -191,10 +193,11 @@ def pip_parse(requirements_lock, name = "pip_parsed_deps", **kwargs):
191
193
of 'requirements' no resolve will take place and pip_repository will create
192
194
individual repositories for each of your dependencies so that wheels are
193
195
fetched/built only for the targets specified by 'build/run/test'.
196
+ Note that if your lockfile is platform-dependent, you can use the `requirements_[platform]`
197
+ attributes.
194
198
name (str, optional): The name of the generated repository. The generated repositories
195
199
containing each requirement will be of the form <name>_<requirement-name>.
196
- **kwargs (dict): Additional keyword arguments for the underlying
197
- `pip_repository` rule.
200
+ **kwargs (dict): Additional arguments to the [`pip_repository`](./pip_repository.md) repository rule.
198
201
"""
199
202
200
203
# Just in case our dependencies weren't already fetched
0 commit comments