• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1workspace(name = "rules_python_multi_python_versions")
2
3local_repository(
4    name = "rules_python",
5    path = "../..",
6)
7
8load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains")
9
10py_repositories()
11
12default_python_version = "3.9"
13
14python_register_multi_toolchains(
15    name = "python",
16    default_version = default_python_version,
17    python_versions = [
18        "3.8",
19        "3.9",
20        "3.10",
21        "3.11",
22    ],
23    register_coverage_tool = True,
24)
25
26load("@python//:pip.bzl", "multi_pip_parse")
27
28multi_pip_parse(
29    name = "pypi",
30    default_version = default_python_version,
31    python_interpreter_target = {
32        "3.10": "@python_3_10_host//:python",
33        "3.11": "@python_3_11_host//:python",
34        "3.8": "@python_3_8_host//:python",
35        "3.9": "@python_3_9_host//:python",
36    },
37    requirements_lock = {
38        "3.10": "//requirements:requirements_lock_3_10.txt",
39        "3.11": "//requirements:requirements_lock_3_11.txt",
40        "3.8": "//requirements:requirements_lock_3_8.txt",
41        "3.9": "//requirements:requirements_lock_3_9.txt",
42    },
43)
44
45load("@pypi//:requirements.bzl", "install_deps")
46
47install_deps()
48
49load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
50
51# See https://github.com/bazelbuild/rules_shell/releases/tag/v0.2.0
52http_archive(
53    name = "rules_shell",
54    sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28",
55    strip_prefix = "rules_shell-0.2.0",
56    url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz",
57)
58
59load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
60
61rules_shell_dependencies()
62
63rules_shell_toolchains()
64