| module( | |
| name = "multi_python_versions", | |
| ) | |
| bazel_dep(name = "bazel_skylib", version = "1.7.1") | |
| bazel_dep(name = "rules_python", version = "0.0.0") | |
| local_path_override( | |
| module_name = "rules_python", | |
| path = "../..", | |
| ) | |
| python = use_extension("@rules_python//python/extensions:python.bzl", "python") | |
| python.defaults( | |
| # The environment variable takes precedence if set. | |
| python_version = "3.10", | |
| python_version_env = "BAZEL_PYTHON_VERSION", | |
| ) | |
| python.toolchain( | |
| configure_coverage_tool = True, | |
| python_version = "3.10", | |
| ) | |
| python.toolchain( | |
| configure_coverage_tool = True, | |
| python_version = "3.11", | |
| ) | |
| python.toolchain( | |
| configure_coverage_tool = True, | |
| python_version = "3.12", | |
| ) | |
| python.toolchain( | |
| configure_coverage_tool = True, | |
| python_version = "3.13", | |
| ) | |
| python.toolchain( | |
| configure_coverage_tool = True, | |
| python_version = "3.14", | |
| ) | |
| use_repo( | |
| python, | |
| "pythons_hub", | |
| python = "python_versions", | |
| ) | |
| pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") | |
| use_repo(pip, "pypi") | |
| pip.parse( | |
| hub_name = "pypi", | |
| python_version = "3.10", | |
| requirements_lock = "//requirements:requirements_lock_3_10.txt", | |
| ) | |
| pip.parse( | |
| hub_name = "pypi", | |
| python_version = "3.11", | |
| requirements_lock = "//requirements:requirements_lock_3_11.txt", | |
| ) | |
| pip.parse( | |
| hub_name = "pypi", | |
| python_version = "3.12", | |
| requirements_lock = "//requirements:requirements_lock_3_12.txt", | |
| ) | |
| pip.parse( | |
| hub_name = "pypi", | |
| python_version = "3.13", | |
| requirements_lock = "//requirements:requirements_lock_3_13.txt", | |
| ) | |
| pip.parse( | |
| hub_name = "pypi", | |
| python_version = "3.14", | |
| requirements_lock = "//requirements:requirements_lock_3_14.txt", | |
| ) | |
| # example test dependencies | |
| bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True) | |
| # Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so | |
| # that --java_runtime_version=remotejdk_11 works with Bazel 8. | |
| bazel_dep(name = "rules_java", version = "8.16.1") |