aboutsummaryrefslogtreecommitdiff
path: root/examples/pip_parse_vendored/WORKSPACE
blob: 157f70aeb68554b79c80e279f687784cdc33d6f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
workspace(name = "pip_repository_annotations_example")

local_repository(
    name = "rules_python",
    path = "../..",
)

load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")

py_repositories()

python_register_toolchains(
    name = "python39",
    python_version = "3.9",
)

load("@python39//:defs.bzl", "interpreter")
load("@rules_python//python:pip.bzl", "pip_parse")

# This repository isn't referenced, except by our test that asserts the requirements.bzl is updated.
# It also wouldn't be needed by users of this ruleset.
pip_parse(
    name = "pip",
    python_interpreter_target = interpreter,
    requirements_lock = "//:requirements.txt",
)

# This example vendors the file produced by `pip_parse` above into the repo.
# This way our Bazel doesn't eagerly fetch and install the pip_parse'd
# repository for builds that don't need it.
# See discussion of the trade-offs in the pip_parse documentation
# and the "vendor_requirements" target in the BUILD file.
load("//:requirements.bzl", "install_deps")

install_deps()