Skip to content

Commit 446f2f6

Browse files
authored
Upgrade rules_python to 1.7.0 and Python to 3.10.19 (#572)
* test * pylint using run * pyinstaller swicth * updated locked requirements * upgrade pydantic to 1.10.26 * fix: include interpreter layer in OCI images for native pip packages
1 parent c359193 commit 446f2f6

File tree

26 files changed

+720
-578
lines changed

26 files changed

+720
-578
lines changed

.bazelrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -37,6 +37,9 @@ query --noexperimental_check_external_repository_files
3737
build --sandbox_default_allow_network=false
3838
build --incompatible_default_to_explicit_init_py
3939

40+
# Disable pipstar (cross-platform wheel resolution) to reduce analysis-phase memory
41+
build --repo_env=RULES_PYTHON_ENABLE_PIPSTAR=0
42+
4043
# Config to stamp the version info on the Python Library wheel when creating distribution
4144
build:stamp_py_wheel --stamp
4245
build:stamp_py_wheel --workspace_status_command=src/lib/distribution/stamp.sh

MODULE.bazel

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ osmo_constants(
6868
# Common #
6969
################
7070

71-
bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
72-
bazel_dep(name = "platforms", version = "0.0.11")
73-
bazel_dep(name = "rules_shell", version = "0.3.0")
71+
bazel_dep(name = "aspect_bazel_lib", version = "2.19.3")
72+
bazel_dep(name = "platforms", version = "1.0.0")
73+
bazel_dep(name = "rules_shell", version = "0.4.1")
7474

7575
################
7676
# Python #
7777
################
7878

79-
bazel_dep(name = "aspect_rules_py", version = "1.3.2")
80-
bazel_dep(name = "rules_python", version = "1.5.1")
79+
bazel_dep(name = "aspect_rules_py", version = "1.8.4")
80+
bazel_dep(name = "rules_python", version = "1.8.4")
8181

8282
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
8383
python.toolchain(
8484
ignore_root_user_error = True,
8585
is_default = True,
86-
python_version = "3.10.18",
86+
python_version = "3.10.19",
8787
)
8888

8989
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
@@ -98,7 +98,7 @@ pip.parse(
9898
"30",
9999
],
100100
hub_name = "osmo_mypy_deps",
101-
python_version = "3.10.18",
101+
python_version = "3.10.19",
102102
requirements_lock = "//bzl/mypy:locked_requirements.txt",
103103
)
104104
use_repo(pip, "osmo_mypy_deps")
@@ -113,7 +113,7 @@ pip.parse(
113113
"30",
114114
],
115115
hub_name = "pylint_python_deps",
116-
python_version = "3.10.18",
116+
python_version = "3.10.19",
117117
requirements_lock = "//bzl/linting:locked_requirements.txt",
118118
)
119119
use_repo(pip, "pylint_python_deps")
@@ -128,7 +128,7 @@ pip.parse(
128128
"30",
129129
],
130130
hub_name = "osmo_python_deps",
131-
python_version = "3.10.18",
131+
python_version = "3.10.19",
132132
requirements_lock = "//src:locked_requirements.txt",
133133
)
134134
use_repo(pip, "osmo_python_deps")
@@ -143,7 +143,7 @@ pip.parse(
143143
"30",
144144
],
145145
hub_name = "osmo_tests_python_deps",
146-
python_version = "3.10.18",
146+
python_version = "3.10.19",
147147
requirements_lock = "//src/tests:locked_requirements.txt",
148148
)
149149
use_repo(pip, "osmo_tests_python_deps")
@@ -152,7 +152,7 @@ use_repo(pip, "osmo_tests_python_deps")
152152
# MyPy #
153153
################
154154

155-
bazel_dep(name = "rules_mypy", version = "0.38.0")
155+
bazel_dep(name = "rules_mypy", version = "0.40.0")
156156

157157
types = use_extension("@rules_mypy//mypy:types.bzl", "types")
158158
types.requirements(
@@ -173,7 +173,7 @@ use_repo(types, "pip_types")
173173
# Bazel Skylib #
174174
################
175175

176-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
176+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
177177

178178
################
179179
# Go #

bzl/linting/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ SPDX-License-Identifier: Apache-2.0
1818

1919
exports_files(
2020
[
21-
"pylint.py",
21+
"run_pylint.py",
2222
"pylintrc",
2323
],
2424
visibility = ["//visibility:public"],

bzl/linting/locked_requirements.txt

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
#
55
# pip-compile --allow-unsafe --generate-hashes --output-file=locked_requirements.txt ./requirements.txt
66
#
7-
astroid==4.0.2 \
8-
--hash=sha256:ac8fb7ca1c08eb9afec91ccc23edbd8ac73bb22cbdd7da1d488d9fb8d6579070 \
9-
--hash=sha256:d7546c00a12efc32650b19a2bb66a153883185d3179ab0d4868086f807338b9b
7+
astroid==4.0.4 \
8+
--hash=sha256:52f39653876c7dec3e3afd4c2696920e05c83832b9737afc21928f2d2eb7a753 \
9+
--hash=sha256:986fed8bcf79fb82c78b18a53352a0b287a73817d6dbcfba3162da36667c49a0
1010
# via pylint
11-
dill==0.3.7 \
12-
--hash=sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e \
13-
--hash=sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03
11+
dill==0.4.1 \
12+
--hash=sha256:1e1ce33e978ae97fcfcff5638477032b801c46c7c65cf717f95fbc2248f79a9d \
13+
--hash=sha256:423092df4182177d4d8ba8290c8a5b640c66ab35ec7da59ccfa00f6fa3eea5fa
1414
# via pylint
15-
isort==5.13.1 \
16-
--hash=sha256:56a51732c25f94ca96f6721be206dd96a95f42950502eb26c1015d333bc6edb7 \
17-
--hash=sha256:aaed790b463e8703fb1eddb831dfa8e8616bacde2c083bd557ef73c8189b7263
15+
isort==7.0.0 \
16+
--hash=sha256:1bcabac8bc3c36c7fb7b98a76c8abb18e0f841a3ba81decac7691008592499c1 \
17+
--hash=sha256:5513527951aadb3ac4292a41a16cbc50dd1642432f5e8c20057d414bdafb4187
1818
# via pylint
1919
mccabe==0.7.0 \
2020
--hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \
2121
--hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e
2222
# via pylint
23-
platformdirs==4.1.0 \
24-
--hash=sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380 \
25-
--hash=sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420
23+
platformdirs==4.9.2 \
24+
--hash=sha256:9170634f126f8efdae22fb58ae8a0eaa86f38365bc57897a6c4f781d1f5875bd \
25+
--hash=sha256:9a33809944b9db043ad67ca0db94b14bf452cc6aeaac46a88ea55b26e2e9d291
2626
# via pylint
2727
pylint==4.0.4 \
2828
--hash=sha256:63e06a37d5922555ee2c20963eb42559918c20bd2b21244e4ef426e7c43b92e0 \
@@ -70,15 +70,60 @@ pyyaml==6.0 \
7070
--hash=sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174 \
7171
--hash=sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5
7272
# via -r requirements.txt
73-
tomli==2.0.1 \
74-
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
75-
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
73+
tomli==2.4.0 \
74+
--hash=sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729 \
75+
--hash=sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b \
76+
--hash=sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d \
77+
--hash=sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df \
78+
--hash=sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576 \
79+
--hash=sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d \
80+
--hash=sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1 \
81+
--hash=sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a \
82+
--hash=sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e \
83+
--hash=sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc \
84+
--hash=sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702 \
85+
--hash=sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6 \
86+
--hash=sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd \
87+
--hash=sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4 \
88+
--hash=sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776 \
89+
--hash=sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a \
90+
--hash=sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66 \
91+
--hash=sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87 \
92+
--hash=sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2 \
93+
--hash=sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f \
94+
--hash=sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475 \
95+
--hash=sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f \
96+
--hash=sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95 \
97+
--hash=sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9 \
98+
--hash=sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3 \
99+
--hash=sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9 \
100+
--hash=sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76 \
101+
--hash=sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da \
102+
--hash=sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8 \
103+
--hash=sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51 \
104+
--hash=sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86 \
105+
--hash=sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8 \
106+
--hash=sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0 \
107+
--hash=sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b \
108+
--hash=sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1 \
109+
--hash=sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e \
110+
--hash=sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d \
111+
--hash=sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c \
112+
--hash=sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867 \
113+
--hash=sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a \
114+
--hash=sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c \
115+
--hash=sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0 \
116+
--hash=sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4 \
117+
--hash=sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614 \
118+
--hash=sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132 \
119+
--hash=sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa \
120+
--hash=sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087
76121
# via pylint
77-
tomlkit==0.12.3 \
78-
--hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \
79-
--hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba
122+
tomlkit==0.14.0 \
123+
--hash=sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680 \
124+
--hash=sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064
80125
# via pylint
81-
typing-extensions==4.9.0 \
82-
--hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \
83-
--hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd
126+
typing-extensions==4.15.0 \
127+
--hash=sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466 \
128+
--hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548
84129
# via astroid
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -16,16 +16,13 @@
1616
SPDX-License-Identifier: Apache-2.0
1717
"""
1818

19-
import os
20-
import subprocess
2119
import sys
2220

21+
from pylint.lint import Run
22+
2323

2424
def main():
25-
# Run pylint in a subprocess
26-
result = subprocess.run([sys.executable, "-m", "pylint"] + sys.argv[1:],
27-
env={"PYTHONPATH": os.environ["PYTHONPATH"]})
28-
sys.exit(result.returncode)
25+
Run(sys.argv[1:])
2926

3027

3128
if __name__ == "__main__":

bzl/mypy/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -58,6 +58,6 @@ mypy_cli(
5858
type_requirement("types-urllib3"),
5959
type_requirement("types-aiofiles"),
6060
],
61-
python_version = "3.10.18",
61+
python_version = "3.10.19",
6262
tags = ["no-mypy"],
6363
)

0 commit comments

Comments
 (0)