Skip to content

Commit

Permalink
slight rewrite on MODULE.bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Nov 8, 2024
1 parent df24c39 commit b924e12
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bazel_dep(name = "scip", version = "8.1.0")
bazel_dep(name = "swig", version = "4.2.0")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")

PYTHON_VERSIONS = [
SUPPORTED_PYTHON_VERSIONS = [
"3.8",
"3.9",
"3.10",
Expand All @@ -37,14 +37,15 @@ PYTHON_VERSIONS = [
"3.13",
]

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
DEFAULT_PYTHON = "3.11"

python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency=True)
[
python.toolchain(
is_default = python_version == PYTHON_VERSIONS[-1],
python_version = python_version,
)
for python_version in PYTHON_VERSIONS
python.toolchain(
python_version = version,
is_default = version == DEFAULT_PYTHON,
)
for version in SUPPORTED_PYTHON_VERSIONS
]

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
Expand All @@ -55,7 +56,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
python_version = python_version,
requirements_lock = "//bazel:ortools_requirements.txt",
)
for python_version in PYTHON_VERSIONS
for python_version in SUPPORTED_PYTHON_VERSIONS
]

[
Expand All @@ -64,7 +65,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
python_version = python_version,
requirements_lock = "//bazel:notebook_requirements.txt",
)
for python_version in PYTHON_VERSIONS
for python_version in SUPPORTED_PYTHON_VERSIONS
]

use_repo(pip, pip_deps = "ortools_pip_deps")
Expand Down

0 comments on commit b924e12

Please sign in to comment.