Skip to content

Commit aee4eef

Browse files
committed
temporary commit to be reverted
1 parent ed5d9c9 commit aee4eef

12 files changed

Lines changed: 119 additions & 40 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ jobs:
105105
python-version: "3.10"
106106
- name: Install nox
107107
run: |
108-
python -m pip install --upgrade setuptools pip wheel
108+
# Workaround: Pin setuptools < 70 to avoid a directory cleanup race condition
109+
# where setuptools deletes the temporary '/bdist' directory mid-build during
110+
# highly parallelized 'uv pip install -e .' editable installations.
111+
python -m pip install --upgrade "setuptools<70.0.0" pip wheel
109112
python -m pip install nox uv
110113
- name: Run docs for ${{ matrix.package_shard.description }}
111114
env:
@@ -154,8 +157,11 @@ jobs:
154157
python-version: "3.10"
155158
- name: Install nox
156159
run: |
157-
python -m pip install --upgrade setuptools pip wheel
158-
python -m pip install nox uv
160+
python -m pip install --upgrade pip wheel
161+
# Workaround: Pin setuptools < 70 to avoid a directory cleanup race condition
162+
# where setuptools deletes the temporary '/bdist' directory mid-build during
163+
# highly parallelized 'uv pip install -e .' editable installations.
164+
python -m pip install nox uv "setuptools<70"
159165
- name: Run docfx
160166
env:
161167
BUILD_TYPE: presubmit

‎.github/workflows/lint.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ jobs:
8888
python-version: "3.14"
8989
- name: Install nox
9090
run: |
91-
python -m pip install --upgrade setuptools pip wheel build twine
92-
python -m pip install nox uv
91+
python -m pip install --upgrade pip wheel build twine
92+
# Workaround: Pin setuptools < 70 to avoid a directory cleanup race condition
93+
# where setuptools deletes the temporary '/bdist' directory mid-build during
94+
# highly parallelized 'uv pip install -e .' editable installations.
95+
python -m pip install nox uv "setuptools<70"
9396
- name: Run lint
9497
env:
9598
BUILD_TYPE: presubmit
@@ -145,8 +148,11 @@ jobs:
145148
python-version: "3.14"
146149
- name: Install nox
147150
run: |
148-
python -m pip install --upgrade setuptools pip wheel
149-
python -m pip install nox uv
151+
python -m pip install --upgrade pip wheel
152+
# Workaround: Pin setuptools < 70 to avoid a directory cleanup race condition
153+
# where setuptools deletes the temporary '/bdist' directory mid-build during
154+
# highly parallelized 'uv pip install -e .' editable installations.
155+
python -m pip install nox uv "setuptools<70"
150156
- name: Run mypy for ${{ matrix.package_shard.description }}
151157
env:
152158
BUILD_TYPE: presubmit

‎.github/workflows/unittest.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ jobs:
131131
cache-dependency-glob: 'packages/**/testing/constraints*.txt'
132132
- name: Install nox and nox-uv
133133
run: |
134-
uv pip install --system nox nox-uv
134+
# Workaround: Pin setuptools < 70 to avoid a directory cleanup race condition
135+
# where setuptools deletes the temporary '/bdist' directory mid-build during
136+
# highly parallelized 'uv pip install -e .' editable installations.
137+
uv pip install --system nox nox-uv "setuptools<70.0.0"
135138
# TODO(https://github.com/googleapis/google-cloud-python/issues/18532):
136139
# Remove UV_PRERELEASE once Python 3.15 is officially released and upstream binary wheels are available.
137140
- name: Enable prereleases for Python 3.15
@@ -239,7 +242,10 @@ jobs:
239242
- name: Install coverage
240243
if: ${{ needs.initialize.outputs.packages != '' }}
241244
run: |
242-
python -m pip install --upgrade setuptools pip wheel
245+
# Workaround: Pin setuptools < 70 to avoid a directory cleanup race condition
246+
# where setuptools deletes the temporary '/bdist' directory mid-build during
247+
# highly parallelized 'uv pip install -e .' editable installations.
248+
python -m pip install --upgrade "setuptools<70" pip wheel
243249
python -m pip install coverage
244250
- name: Download coverage results
245251
if: ${{ needs.initialize.outputs.packages != '' }}

‎ci/run_single_test.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626

2727
set -e
2828

29+
# 1. Force UV to pin setuptools inside Nox environments, resolving the /bdist race condition.
30+
# 2. Redirect TMPDIR to a unique path so parallel workers never cross-contaminate.
31+
export UV_CONSTRAINT="/tmp/constraints.txt"
32+
export TMPDIR=$(mktemp -d)
33+
echo "setuptools<70.0.0" > "${UV_CONSTRAINT}"
34+
export UV_CACHE_DIR="${TMPDIR}/uv_cache"
35+
2936
if [ -z "${TEST_TYPE}" ]; then
3037
echo "missing TEST_TYPE env var"
3138
exit 1

‎packages/gapic-generator/WORKSPACE‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,9 @@ switched_rules_by_language(
177177
gapic = True,
178178
grpc = True,
179179
)
180+
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
181+
python_register_toolchains(
182+
name = "python311",
183+
python_version = "3.11",
184+
)
185+

‎packages/gapic-generator/gapic/templates/setup.py.j2‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,20 @@ else:
3737

3838
dependencies = [
3939
{% if api.has_resumable_upload_methods %}
40-
"google-api-core[grpc] >= 2.41.0, <3.0.0",
40+
# TODO: For prototyping purposes only, revert once https://github.com/googleapis/google-cloud-python/pull/18551 is merged
41+
"google-api-core[grpc] @ git+https://github.com/googleapis/google-cloud-python.git#subdirectory=packages/google-api-core",
42+
# TODO: Uncomment the line below
43+
# "google-api-core[grpc] >= 2.41.0, <3.0.0",
44+
# TODO: For prototyping purposes only, revert once https://github.com/googleapis/google-cloud-python/pull/18552 is merged
45+
"google-auth[aiohttp] @ git+https://github.com/googleapis/google-cloud-python.git#subdirectory=packages/google-auth",
46+
# TODO: Uncomment the line below
47+
# "google-auth[aiohttp] >= 2.60.0, <3.0.0",
4148
{% else %}
4249
"google-api-core[grpc] >= 2.28.0, <3.0.0",
43-
{% endif %}
4450
# Exclude incompatible versions of `google-auth`
4551
# See https://github.com/googleapis/google-cloud-python/issues/12364
4652
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
53+
{% endif %}
4754
"grpcio >= 1.59.0, < 2.0.0",
4855
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
4956
"proto-plus >= 1.26.1, <2.0.0",
@@ -61,8 +68,14 @@ dependencies = [
6168
extras = {
6269
{% if rest_async_io_enabled %}
6370
"async_rest": [
64-
"google-auth[aiohttp] >= 2.60.0, <3.0.0",
65-
"google-api-core >= 2.41.0, <3.0.0",
71+
# TODO: For prototyping purposes only, revert once https://github.com/googleapis/google-cloud-python/pull/18552 is merged
72+
"google-auth[aiohttp] @ git+https://github.com/googleapis/google-cloud-python.git#subdirectory=packages/google-auth",
73+
# TODO: Uncomment the line below
74+
# "google-auth[aiohttp] >= 2.60.0, <3.0.0",
75+
# TODO: For prototyping purposes only, revert once https://github.com/googleapis/google-cloud-python/pull/18551 is merged
76+
"google-api-core[grpc] @ git+https://github.com/googleapis/google-cloud-python.git#subdirectory=packages/google-api-core",
77+
# TODO: Uncomment the line below
78+
# "google-api-core >= 2.41.0, <3.0.0",
6679
],
6780
{% endif %}
6881
}

‎packages/gapic-generator/gapic/templates/testing/_default_constraints.j2‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{% from '_pypi_packages.j2' import pypi_packages %}
22
# This constraints file is required for unit tests.
33
# List all library dependencies and extras in this file.
4-
google-api-core
5-
google-auth
4+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18551 is merged
5+
# google-api-core
6+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18552 is merged
7+
# google-auth
68
grpcio
79
proto-plus
810
protobuf

‎packages/gapic-generator/gapic/templates/testing/constraints-3.10-async-rest.txt.j2‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
1010
# then this file should have google-cloud-foo==1.14.0
1111
{% if api.has_resumable_upload_methods %}
12-
google-api-core==2.41.0
12+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18551 is merged
13+
# google-api-core==2.41.0
1314
{% else %}
1415
google-api-core==2.28.0
1516
{% endif %}
16-
google-auth==2.35.0
17+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18552 is merged
18+
# google-auth==2.35.0
1719
grpcio==1.59.0
1820
proto-plus==1.26.1
1921
protobuf==6.33.5

‎packages/gapic-generator/gapic/templates/testing/constraints-3.10.txt.j2‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
77
# then this file should have google-cloud-foo==1.14.0
88
{% if api.has_resumable_upload_methods %}
9-
google-api-core==2.41.0
9+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18551 is merged
10+
# google-api-core==2.41.0
1011
{% else %}
11-
google-api-core==2.28.0
12+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18551 is merged
13+
# google-api-core==2.28.0
1214
{% endif %}
13-
google-auth==2.14.1
15+
# TODO: Uncomment the line below once https://github.com/googleapis/google-cloud-python/pull/18552 is merged
16+
# google-auth==2.14.1
1417
grpcio==1.59.0
1518
proto-plus==1.26.1
1619
protobuf==6.33.5

‎packages/gapic-generator/noxfile.py‎

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ def unit(session):
8282
"grpcio-status",
8383
"proto-plus",
8484
)
85-
session.install("-e", ".")
85+
session.install("setuptools<70.0.0", "wheel")
86+
session.run("uv", "build", "--wheel", "--out-dir", "/tmp/wheels", "../google-api-core")
87+
session.run("uv", "build", "--wheel", "--out-dir", "/tmp/wheels", "../google-auth")
88+
session.run(
89+
"uv", "pip", "install",
90+
"/tmp/wheels/google_api_core-2.40.0-py3-none-any.whl",
91+
"/tmp/wheels/google_auth-2.59.1-py3-none-any.whl"
92+
)
93+
session.run("uv", "pip", "install", ".")
8694
session.run(
8795
"py.test",
8896
*(
@@ -98,6 +106,9 @@ def unit(session):
98106
path.join("tests", "unit"),
99107
]
100108
),
109+
# `test_utils` is not part of the installed package (only `gapic` is
110+
# included in setup.py), but it is needed for running tests.
111+
env={"PYTHONPATH": "."},
101112
)
102113

103114

@@ -150,7 +161,7 @@ def __call__(self, frag):
150161

151162
# Install the generated fragment library.
152163
if self.use_ads_templates:
153-
self.session.install(tmp_dir, "-e", ".", "-qqq")
164+
self.session.install(tmp_dir, ".", "-qqq")
154165
else:
155166
# Use the constraints file for the specific python runtime version.
156167
# We do this to make sure that we're testing against the lowest
@@ -161,7 +172,7 @@ def __call__(self, frag):
161172
constraints_path = str(
162173
f"{tmp_dir}/testing/constraints-{self.session.python}.txt"
163174
)
164-
self.session.install(tmp_dir, "-e", ".", "-qqq", "-r", constraints_path)
175+
self.session.install(tmp_dir, ".", "-qqq", "-r", constraints_path)
165176

166177
# Run the fragment's generated unit tests.
167178
# Don't bother parallelizing them: we already parallelize
@@ -191,7 +202,7 @@ def fragment(session, use_ads_templates=False):
191202
"pytest-asyncio",
192203
"grpcio-tools",
193204
)
194-
session.install("-e", ".")
205+
session.install(".")
195206

196207
frag_files = (
197208
[Path(f) for f in session.posargs] if session.posargs else FRAGMENT_FILES
@@ -273,7 +284,7 @@ def showcase_library(
273284
session.log("-" * 70)
274285

275286
# Install gapic-generator-python
276-
session.install("-e", ".")
287+
session.install(".")
277288

278289
# Install grpcio-tools for protoc
279290
session.install("grpcio-tools")
@@ -445,7 +456,7 @@ def showcase(
445456
session.error(
446457
f"INSTALL_LOCAL_CORE is set to 'true' but {local_core} does not exist."
447458
)
448-
session.install("-e", str(local_core))
459+
session.install(str(local_core))
449460

450461
# Use pytest-asyncio<1.0.0 while we investigate the recent failure described in
451462
# https://github.com/googleapis/gapic-generator-python/issues/2399
@@ -491,7 +502,7 @@ def showcase_w_rest_async(
491502
session.error(
492503
f"INSTALL_LOCAL_CORE is set to 'true' but {local_core} does not exist."
493504
)
494-
session.install("-e", str(local_core))
505+
session.install(str(local_core))
495506

496507
# Use pytest-asyncio<1.0.0 while we investigate the recent failure described in
497508
# https://github.com/googleapis/gapic-generator-python/issues/2399
@@ -743,7 +754,7 @@ def snippetgen(session):
743754
)
744755

745756
# Install gapic-generator-python
746-
session.install("-e", ".")
757+
session.install(".")
747758

748759
session.install("grpcio-tools", "pytest", "pytest-asyncio")
749760

@@ -754,8 +765,15 @@ def snippetgen(session):
754765
def docs(session):
755766
"""Build the docs for this generator."""
756767

757-
session.install("-e", ".")
758-
768+
session.install("setuptools<70.0.0", "wheel")
769+
session.run("uv", "build", "--wheel", "--out-dir", "/tmp/wheels", "../google-api-core")
770+
session.run("uv", "build", "--wheel", "--out-dir", "/tmp/wheels", "../google-auth")
771+
session.run(
772+
"uv", "pip", "install",
773+
"/tmp/wheels/google_api_core-2.40.0-py3-none-any.whl",
774+
"/tmp/wheels/google_auth-2.59.1-py3-none-any.whl"
775+
)
776+
session.run("uv", "pip", "install", ".")
759777
session.install(
760778
# We need to pin to specific versions of the `sphinxcontrib-*` packages
761779
# which still support sphinx 4.x.
@@ -790,7 +808,7 @@ def docs(session):
790808
def docfx(session):
791809
"""Build the docfx yaml files for this library."""
792810

793-
session.install("-e", ".")
811+
session.install(".")
794812
session.install(
795813
# We need to pin to specific versions of the `sphinxcontrib-*` packages
796814
# which still support sphinx 4.x.
@@ -843,7 +861,14 @@ def mypy(session):
843861
"types-dataclasses",
844862
"click==8.1.3",
845863
)
846-
session.install(".")
864+
session.run("uv", "build", "--wheel", "--out-dir", "/tmp/wheels", "../google-api-core")
865+
session.run("uv", "build", "--wheel", "--out-dir", "/tmp/wheels", "../google-auth")
866+
session.run(
867+
"uv", "pip", "install",
868+
"/tmp/wheels/google_api_core-2.40.0-py3-none-any.whl",
869+
"/tmp/wheels/google_auth-2.59.1-py3-none-any.whl"
870+
)
871+
session.run("uv", "pip", "install", ".")
847872
session.run("mypy", f"--config-file={MYPY_CONFIG_FILE}", "-p", "gapic")
848873

849874

0 commit comments

Comments
 (0)