blob: 7b88bd73ffd71e00c6093b2a4b246a0d9142f965 [file] [log] [blame]
module(
name = "other_module",
)
# This module is using the same version of rules_python
# that the parent module uses.
bazel_dep(name = "rules_python", version = "")
local_path_override(
module_name = "rules_python",
path = "../../..",
)
PYTHON_NAME_39 = "python_3_9"
PYTHON_NAME_311 = "python_3_11"
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.defaults(
# In a submodule this is ignored
python_version = "3.11",
)
python.toolchain(
configure_coverage_tool = True,
python_version = "3.9",
)
python.toolchain(
configure_coverage_tool = True,
python_version = "3.11",
)
# created by the above python.toolchain calls.
use_repo(
python,
"python_versions",
PYTHON_NAME_39,
PYTHON_NAME_311,
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "other_module_pip",
# NOTE: This version must be different than the root module's
# default python version.
# This is testing that a sub-module can use pip.parse() and only specify
# Python versions that DON'T include whatever the root-module's default
# Python version is.
python_version = "3.11",
requirements_lock = ":requirements_lock_3_11.txt",
)
use_repo(pip, "other_module_pip")