Skip to content

Commit 3fa57d6

Browse files
committed
fix
2 parents d8d6707 + 7cafd7c commit 3fa57d6

File tree

6 files changed

+1677
-217
lines changed

6 files changed

+1677
-217
lines changed

MODULE.bazel

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -80,50 +80,35 @@ git_override(
8080
remote = "https://github.com/pybind/pybind11_protobuf.git",
8181
)
8282

83-
SUPPORTED_PYTHON_VERSIONS = [
84-
"3.9",
85-
"3.10",
86-
"3.11",
87-
"3.12",
88-
"3.13",
89-
]
83+
# Python
84+
# https://rules-python.readthedocs.io/en/latest/toolchains.html#library-modules-with-dev-only-python-usage
9085

9186
DEFAULT_PYTHON = "3.12"
9287

9388
python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
94-
95-
[
96-
python.toolchain(
97-
ignore_root_user_error = True, # needed for CI
98-
is_default = version == DEFAULT_PYTHON,
99-
python_version = version,
100-
)
101-
for version in SUPPORTED_PYTHON_VERSIONS
102-
]
89+
python.defaults(python_version = DEFAULT_PYTHON)
90+
python.toolchain(python_version = DEFAULT_PYTHON)
10391

10492
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
105-
10693
[
10794
pip.parse(
108-
hub_name = "ortools_pip_deps",
109-
python_version = python_version,
110-
requirements_lock = "//bazel:ortools_requirements.txt",
95+
envsubst = ["PIP_INDEX_URL"],
96+
experimental_index_url = "${PIP_INDEX_URL:-https://pypi.org/simple}",
97+
hub_name = hub_name,
98+
python_version = DEFAULT_PYTHON,
99+
requirements_lock = requirements_lock,
111100
)
112-
for python_version in SUPPORTED_PYTHON_VERSIONS
113-
]
114-
115-
[
116-
pip.parse(
117-
hub_name = "ortools_notebook_deps",
118-
python_version = python_version,
119-
requirements_lock = "//bazel:notebook_requirements.txt",
120-
)
121-
for python_version in SUPPORTED_PYTHON_VERSIONS
101+
for hub_name, requirements_lock in [
102+
("ortools_pip_deps", "//bazel:ortools_requirements.txt"),
103+
("ortools_notebook_deps", "//bazel:notebook_requirements.txt"),
104+
]
122105
]
123106

124107
use_repo(pip, pip_deps = "ortools_pip_deps")
125108
use_repo(pip, "ortools_notebook_deps")
126109

110+
# Java
111+
127112
JUNIT_PLATFORM_VERSION = "1.9.2"
128113

129114
JUNIT_JUPITER_VERSION = "5.9.2"

bazel/BUILD.bazel

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,26 @@
1313

1414
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
1515

16+
extra_args = [
17+
"--no-emit-index-url",
18+
"--reuse-hashes",
19+
"--verbose",
20+
]
21+
1622
compile_pip_requirements(
1723
name = "ortools_requirements",
18-
extra_args = [
19-
"--allow-unsafe", # Pin packages considered unsafe
20-
"--resolver=backtracking", # Avoid warning, new default
21-
],
22-
generate_hashes = False,
23-
requirements_in = "ortools_requirements.in",
24+
src = "ortools_requirements.in",
25+
extra_args = extra_args,
26+
generate_hashes = True,
2427
requirements_txt = "ortools_requirements.txt",
2528
)
2629

2730
compile_pip_requirements(
2831
name = "notebook_requirements",
29-
extra_args = [
30-
"--allow-unsafe", # Pin packages considered unsafe
31-
"--resolver=backtracking", # Avoid warning, new default
32-
],
33-
generate_hashes = False,
34-
requirements_in = "notebook_requirements.in",
32+
src = "notebook_requirements.in",
33+
data = ["ortools_requirements.in"],
34+
extra_args = extra_args,
35+
generate_hashes = True,
3536
requirements_txt = "notebook_requirements.txt",
3637
)
3738

bazel/notebook_requirements.in

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
# OR-Tools code dependencies
2-
absl-py==2.3.1
3-
immutabledict==4.2.2
4-
numpy==2.3.5
5-
protobuf==6.32.0
6-
requests==2.32.4
7-
scipy==1.16.3
8-
typing-extensions==4.15.0
9-
10-
# OR-Tools build dependencies
11-
mypy==1.6.1
12-
mypy-protobuf==3.5.0
13-
virtualenv==20.28.1
14-
black==24.8.0
15-
16-
# Example dependencies
17-
pandas==2.3.3
1+
-r ortools_requirements.in
182

193
# Visualization dependencies
20-
svgwrite==1.4.3
214
plotly==5.15.0
225

236
# Notebook

0 commit comments

Comments
 (0)