aboutsummaryrefslogtreecommitdiff
path: root/tests/pip_repository_entry_points/WORKSPACE
blob: 1afd68c2153e18c8be893a0865f6b06744e5a8f6 (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
36
37
38
39
40
41
42
43
44
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()

# This toolchain is explicitly 3.10 while `rules_python` is 3.9 to act as
# a regression test, ensuring 3.10 is functional
python_register_toolchains(
    name = "python310",
    python_version = "3.10",
)

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

# For a more thorough example of `pip_parse`. See `@rules_python//examples/pip_parse`
pip_parse(
    name = "pip_parsed",
    python_interpreter_target = interpreter,
    requirements_lock = "//:requirements.txt",
    requirements_windows = "//:requirements_windows.txt",
)

load("@pip_parsed//:requirements.bzl", install_pip_parse_deps = "install_deps")

install_pip_parse_deps()

# For a more thorough example of `pip_install`. See `@rules_python//examples/pip_install`
pip_install(
    name = "pip_installed",
    python_interpreter_target = interpreter,
    requirements = "//:requirements.txt",
    requirements_windows = "//:requirements_windows.txt",
)

load("@pip_installed//:requirements.bzl", install_pip_install_deps = "install_deps")

install_pip_install_deps()