workspace(name = "pip_repository_annotations_example")

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

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

# 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",
)

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

install_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",
)
