Skip to content

Commit c1898ff

Browse files
authored
Fix pip ResolutionTooDeep (#39017)
* Fix pip ResolutionTooDeep * added constraints file * added dill * Add usage comment
1 parent 8c311e4 commit c1898ff

4 files changed

Lines changed: 56 additions & 15 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run.",
3-
"modification": 3
3+
"modification": 5
44
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Constraints file to pin versions and avoid pip ResolutionTooDeep.
19+
# This file is used with: pip install -c constraints.txt -r requirements.txt
20+
21+
# Core dependencies
22+
tfx_bsl==1.15.1
23+
tensorflow-transform==1.15.0
24+
25+
# TensorFlow ecosystem
26+
tensorflow==2.15.1
27+
tensorflow-metadata==1.15.0
28+
tf-keras==2.15.1
29+
30+
# NumPy and data handling
31+
numpy==1.26.4
32+
pyarrow==10.0.1
33+
34+
# Google Cloud (pin to avoid transitive resolution)
35+
google-cloud-aiplatform==1.60.0
36+
google-api-core==2.19.1
37+
38+
# Note: google-auth is NOT constrained - let pip resolve it to satisfy
39+
# apache-beam's google-genai requirement (>=2.48.1)
40+
41+
# Note: tensorflow-serving-api is NOT constrained - let pip resolve it within
42+
# the range specified in requirements.txt (>=2.15,<2.16)

sdks/python/apache_beam/testing/benchmarks/cloudml/requirements.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
# limitations under the License.
1616
#
1717

18-
dill==0.4.1
19-
tfx_bsl==1.16.1
20-
tensorflow-transform==1.16.0
21-
tensorflow>=2.16,<2.17
18+
# Core TFT dependencies with version bounds.
19+
# Note: To avoid pip ResolutionTooDeep errors, always install using the constraints file:
20+
# pip install -c constraints.txt -r requirements.txt
21+
dill>=0.3,<0.5
22+
tfx_bsl>=1.15,<1.17
23+
tensorflow-transform>=1.15,<1.17
24+
tensorflow>=2.15,<2.16
2225
numpy>=1.22.0,<2.0
23-
tensorflow-metadata>=1.16.1,<1.17.0
26+
tensorflow-metadata>=1.15,<1.16
2427
pyarrow>=10,<11
25-
tensorflow-serving-api>=2.16.1,<2.20
26-
tf-keras>=2.16.0,<2.17
28+
tensorflow-serving-api>=2.15,<2.16
29+
tf-keras>=2.15,<2.16

sdks/python/test-suites/dataflow/common.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,9 @@ task installTFTRequirements {
573573
exec {
574574
workingDir "$rootProject.projectDir/sdks/python/apache_beam/testing/benchmarks/cloudml/"
575575
executable 'sh'
576-
// installGcpTest already installed apache-beam[gcp]. tensorflow-transform also
577-
// lists that dependency, so a plain pip install -r can re-resolve the GCP extra
578-
// and hit ResolutionTooDeep. Install TFT with --no-deps instead.
579-
args '-c', ". ${envdir}/bin/activate && " +
580-
"grep -v '^tensorflow-transform' requirements.txt > /tmp/cloudml_tft_base_requirements.txt && " +
581-
"pip install -r /tmp/cloudml_tft_base_requirements.txt && " +
582-
"pip install --no-deps tensorflow-transform==1.16.0"
576+
// Use constraints file to pin versions while allowing pip to
577+
// resolve compatible versions within the specified ranges in requirements.txt
578+
args '-c', ". ${envdir}/bin/activate && pip install -c constraints.txt -r requirements.txt"
583579
}
584580
}
585581
}

0 commit comments

Comments
 (0)