Skip to content

Commit deac934

Browse files
committed
Merge remote-tracking branch 'upstream/master' into xds_python_protos_move
2 parents 9bc46ed + 998046f commit deac934

File tree

17 files changed

+100
-78
lines changed

17 files changed

+100
-78
lines changed

.pylintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[MAIN]
2+
py-version = 3.9
23
load-plugins=
34
pylint.extensions.no_self_use,
45
pylint.extensions.comparison_placement,
@@ -10,6 +11,9 @@ ignore=
1011
src/python/grpcio/grpc/framework/common,
1112
src/python/grpcio/grpc/framework/foundation,
1213
src/python/grpcio/grpc/framework/interfaces,
14+
ignore-patterns=
15+
.*pb2\.py,
16+
.*pb2_grpc\.py,
1317

1418
extension-pkg-whitelist=grpc._cython.cygrpc
1519

.pylintrc-examples

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[MAIN]
2+
py-version = 3.9
23
load-plugins=
34
pylint.extensions.no_self_use,
45
pylint.extensions.comparison_placement,
@@ -10,6 +11,9 @@ ignore=
1011
src/python/grpcio/grpc/framework/common,
1112
src/python/grpcio/grpc/framework/foundation,
1213
src/python/grpcio/grpc/framework/interfaces,
14+
ignore-patterns=
15+
.*pb2\.py,
16+
.*pb2_grpc\.py,
1317

1418
[VARIABLES]
1519

.pylintrc-tests

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[MAIN]
2+
py-version = 3.9
23
load-plugins=
34
pylint.extensions.no_self_use,
45
pylint.extensions.comparison_placement,
@@ -9,6 +10,9 @@ ignore=
910
src/python/grpcio_tests/tests/unit/framework,
1011
src/python/grpcio_tests/tests/unit/framework/common,
1112
src/python/grpcio_tests/tests/unit/framework/foundation,
13+
ignore-patterns=
14+
.*pb2\.py,
15+
.*pb2_grpc\.py,
1216

1317
[VARIABLES]
1418

bazel/generate_cc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def generate_cc_impl(ctx):
6363
includes = [
6464
f
6565
for src in ctx.attr.srcs
66-
for f in src[ProtoInfo].transitive_imports.to_list()
66+
for f in src[ProtoInfo].transitive_sources.to_list()
6767
]
6868
outs = []
6969
proto_root = get_proto_root(

bazel/generate_objc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _generate_objc_impl(ctx):
4040
protos = [
4141
f
4242
for src in ctx.attr.deps
43-
for f in src[ProtoInfo].transitive_imports.to_list()
43+
for f in src[ProtoInfo].transitive_sources.to_list()
4444
]
4545

4646
target_package = _join_directories([ctx.label.workspace_root, ctx.label.package])

bazel/protobuf.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def includes_from_deps(deps):
233233
return [
234234
file
235235
for src in deps
236-
for file in src[ProtoInfo].transitive_imports.to_list()
236+
for file in src[ProtoInfo].transitive_sources.to_list()
237237
]
238238

239239
def get_proto_arguments(protos, genfiles_dir_path):

bazel/python_rules.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _gen_py_aspect_impl(target, context):
6262
for p in target[ProtoInfo].direct_sources:
6363
protos.append(get_staged_proto_file(target.label, context, p))
6464

65-
includes = depset(direct = protos, transitive = [target[ProtoInfo].transitive_imports])
65+
includes = depset(direct = protos, transitive = [target[ProtoInfo].transitive_sources])
6666
out_files = (declare_out_files(protos, context, _GENERATED_PROTO_FORMAT) +
6767
declare_out_files(protos, context, _GENERATED_PROTO_STUB_FORMAT))
6868
generated_py_srcs = out_files

grpc-style-config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ target-version = [
44
"py39",
55
"py310",
66
"py311",
7+
"py312",
8+
"py313",
79
]
810
extend-exclude = '''
911
# A regex preceded with ^/ will apply only to files and directories
@@ -29,6 +31,9 @@ extend-exclude = '''
2931

3032
[tool.isort]
3133
profile = "black"
34+
py_version = 39
35+
follow_links = false
36+
3237
line_length = 80
3338
src_paths = [
3439
"examples/python/data_transmission",
@@ -48,6 +53,7 @@ skip_glob = [
4853
"*pb2*.pyi",
4954
"**/site-packages/**/*",
5055
"py_xds_protos/*",
56+
"**/.venv-*",
5157
]
5258
single_line_exclusions = ["typing"]
5359
force_single_line = true

requirements.bazel.lock

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
55
# pip-compile --allow-unsafe --output-file=requirements.bazel.lock requirements.bazel.txt
@@ -26,13 +26,13 @@ deprecated==1.2.18
2626
# via
2727
# opentelemetry-api
2828
# opentelemetry-semantic-conventions
29-
gevent==24.2.1
29+
gevent==25.9.1
3030
# via -r requirements.bazel.txt
3131
google-auth==2.38.0
3232
# via -r requirements.bazel.txt
3333
googleapis-common-protos==1.66.0
3434
# via -r requirements.bazel.txt
35-
greenlet==3.1.1
35+
greenlet==3.2.4
3636
# via gevent
3737
hyperlink==21.0.0
3838
# via twisted
@@ -77,7 +77,7 @@ pyasn1==0.6.1
7777
# rsa
7878
pyasn1-modules==0.4.1
7979
# via google-auth
80-
pyyaml==6.0.2
80+
pyyaml==6.0.3
8181
# via -r requirements.bazel.txt
8282
requests==2.32.3
8383
# via
@@ -89,7 +89,7 @@ tomli==2.2.1
8989
# via incremental
9090
twisted==24.11.0
9191
# via -r requirements.bazel.txt
92-
typeguard==4.2.1
92+
typeguard==4.4.2
9393
# via -r requirements.bazel.txt
9494
typing-extensions==4.12.2
9595
# via
@@ -115,8 +115,7 @@ zope-interface==7.2
115115
# twisted
116116

117117
# The following packages are considered to be unsafe in a requirements file:
118-
setuptools==77.0.1 ; python_version > "3.8" # Manually added for python > 3.8, until Bazel RBE jobs support Python >= 3.9 (Tech debt: b/427881645)
119-
setuptools==75.3.2 ; python_version <= "3.8"
118+
setuptools==77.0.1
120119
# via
121120
# -r requirements.bazel.txt
122121
# incremental

requirements.bazel.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Instructions for generation follow:
1717
# Use the oldest supported version of Python
1818
#
19-
# $ docker run -it --rm -v $(pwd):/grpc python:3.8 /bin/bash
19+
# $ docker run -it --rm -v $(pwd):/grpc python:3.9 /bin/bash
2020
# # cd grpc
2121
# # pip install pip-tools
2222
# # pip-compile --allow-unsafe requirements.bazel.txt -o requirements.bazel.lock
@@ -26,17 +26,21 @@
2626
# When installing a new package, sometimes it's desirable to avoid unnecessary
2727
# package upgrades. In such case, consider the following flow instead.
2828
#
29-
# $ python3.8 -m venv .venv-bazel
29+
# $ python3.9 -m venv .venv-bazel
3030
# $ source .venv-bazel/bin/activate
3131
# $ pip install pip-tools
32-
# $ pip install -r requirements.bazel.lock # make the change to version in requirements.bazel.txt after this
32+
# $ pip install -r requirements.bazel.lock
33+
#
34+
# Add the new package to requirements.bazel.txt
3335
# $ pip-compile --no-upgrade --allow-unsafe requirements.bazel.txt -o requirements.bazel.lock
34-
# $ deactivate
36+
#
37+
# To update a single package, change its version spec requirements.bazel.txt
38+
# $ pip-compile --no-upgrade --allow-unsafe requirements.bazel.txt -o requirements.bazel.lock -P package_name
3539

3640
absl-py
3741
certifi
3842
chardet
39-
gevent
43+
gevent~=25.8
4044
google-auth
4145
googleapis-common-protos
4246
idna
@@ -47,11 +51,8 @@ opentelemetry-sdk
4751
protobuf
4852
pyyaml # for DNS test
4953
requests
50-
setuptools>=77.0.1; python_version > "3.8"
51-
setuptools>=75.3.2; python_version <= "3.8"
52-
# Currently our CI uses Python < 3.8, hence <4.4.1 was added
53-
# TODO(asheshvidyut): remove the <4.4.1, when CI uses python >= 3.9
54-
typeguard~=4.2.0,<4.4.1
54+
setuptools>=77.0.1
55+
typeguard~=4.2
5556
typing-extensions==4.12.2
5657
twisted # for DNS test
5758
urllib3

0 commit comments

Comments
 (0)