GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Unbreak Python 3.12 unit tests · juni2003/python-aiplatform@add2f92

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • noxfile.py
  • setup.py
  • testing
    • constraints-3.12.txt
  • tests/unit
    • conftest.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎noxfile.py‎

Copy file name to clipboardExpand all lines: noxfile.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def default(session):
180180
"--cov-config=.coveragerc",
181181
"--cov-report=",
182182
"--cov-fail-under=0",
183+
"--ignore=tests/unit/vertex_ray",
183184
os.path.join("tests", "unit"),
184185
*session.posargs,
185186
)
Collapse file

‎setup.py‎

Copy file name to clipboardExpand all lines: setup.py
+27-11Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
if package.startswith("google.cloud.aiplatform.preview.vertex_ray")
4747
]
4848

49-
tensorboard_extra_require = ["tensorflow >=2.3.0, <2.15.0"]
49+
# TODO(b/333098166, b/312527978): Add python_version>3.11 when tensorflow>2.16.1
50+
# works for tensorboard.
51+
tensorboard_extra_require = ["tensorflow >=2.3.0, <2.15.0; python_version<='3.11'"]
5052
metadata_extra_require = ["pandas >= 1.0.0", "numpy>=1.15.0"]
5153
xai_extra_require = ["tensorflow >=2.3.0, <3.0.0dev"]
5254
lit_extra_require = [
@@ -70,7 +72,8 @@
7072
]
7173
datasets_extra_require = [
7274
"pyarrow >= 3.0.0, < 8.0dev; python_version<'3.11'",
73-
"pyarrow >= 10.0.1; python_version>='3.11'",
75+
"pyarrow >= 10.0.1; python_version=='3.11'",
76+
"pyarrow >= 14.0.0; python_version>='3.12'",
7477
]
7578

7679
vizier_extra_require = [
@@ -87,7 +90,10 @@
8790

8891
endpoint_extra_require = ["requests >= 2.28.1"]
8992

90-
private_endpoints_extra_require = ["urllib3 >=1.21.1, <1.27", "requests >= 2.28.1"]
93+
private_endpoints_extra_require = [
94+
"urllib3 >=1.21.1, <1.27",
95+
"requests >= 2.28.1",
96+
]
9197

9298
autologging_extra_require = ["mlflow>=1.27.0,<=2.1.1"]
9399

@@ -98,9 +104,12 @@
98104

99105
ray_extra_require = [
100106
# Cluster only supports 2.4.0 and 2.9.3
101-
"ray[default] >= 2.4, <= 2.9.3,!= 2.5.*,!= 2.6.*,!= 2.7.*,!= 2.8.*,!=2.9.0,!=2.9.1,!=2.9.2; python_version<'3.11'",
107+
(
108+
"ray[default] >= 2.4, <= 2.9.3,!= 2.5.*,!= 2.6.*,!= 2.7.*,!="
109+
" 2.8.*,!=2.9.0,!=2.9.1,!=2.9.2; python_version<'3.11'"
110+
),
102111
# Ray Data v2.4 in Python 3.11 is broken, but got fixed in Ray v2.5.
103-
"ray[default] >= 2.5, <= 2.9.3; python_version>='3.11'",
112+
"ray[default] >= 2.5, <= 2.9.3; python_version=='3.11'",
104113
"google-cloud-bigquery-storage",
105114
"google-cloud-bigquery",
106115
"pandas >= 1.0.0, < 2.2.0",
@@ -119,7 +128,10 @@
119128
ray_testing_extra_require = ray_extra_require + [
120129
"pytest-xdist",
121130
# ray train extras required for prediction tests
122-
"ray[train] >= 2.4, <= 2.9.3,!= 2.5.*,!= 2.6.*,!= 2.7.*,!= 2.8.*,!=2.9.0,!=2.9.1,!=2.9.2",
131+
(
132+
"ray[train] >= 2.4, <= 2.9.3,!= 2.5.*,!= 2.6.*,!= 2.7.*,!="
133+
" 2.8.*,!=2.9.0,!=2.9.1,!=2.9.2"
134+
),
123135
# Framework version constraints copied from testing_extra_require
124136
"scikit-learn",
125137
"tensorflow",
@@ -167,14 +179,15 @@
167179
"pytest-xdist",
168180
"scikit-learn",
169181
# Lazy import requires > 2.12.0
170-
"tensorflow == 2.13.0",
182+
"tensorflow == 2.13.0; python_version<='3.11'",
183+
"tensorflow == 2.16.1; python_version>'3.11'",
171184
# TODO(jayceeli) torch 2.1.0 has conflict with pyfakefs, will check if
172185
# future versions fix this issue
173-
"torch >= 2.0.0, < 2.1.0",
174-
"xgboost",
175-
"xgboost_ray",
186+
"torch >= 2.0.0, < 2.1.0; python_version<='3.11'",
187+
"torch >= 2.2.0; python_version>'3.11'",
176188
"requests-toolbelt < 1.0.0",
177189
"immutabledict",
190+
"xgboost",
178191
]
179192
)
180193

@@ -200,7 +213,10 @@
200213
platforms="Posix; MacOS X; Windows",
201214
include_package_data=True,
202215
install_requires=(
203-
"google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
216+
(
217+
"google-api-core[grpc] >= 1.34.1,"
218+
" <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*"
219+
),
204220
"google-auth >= 2.14.1, <3.0.0dev",
205221
"proto-plus >= 1.22.0, <2.0.0dev",
206222
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
Collapse file

‎testing/constraints-3.12.txt‎

Copy file name to clipboardExpand all lines: testing/constraints-3.12.txt
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@
44
google-api-core
55
proto-plus
66
protobuf
7+
mock==4.0.2
8+
google-cloud-storage==2.2.1 # Increased for kfp 2.0 compatibility
9+
pytest-xdist==3.3.1 # Pinned to unbreak unit tests
10+
ray==2.5.0 # Pinned until 2.9.3 is verified for Ray tests
11+
ipython==8.22.2 # Pinned to unbreak TypeAliasType import error
Collapse file

‎tests/unit/conftest.py‎

Copy file name to clipboard
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Copyright 2023 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# 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+
import sys
19+
20+
collect_ignore = []
21+
22+
if sys.version_info > (3, 11):
23+
collect_ignore = [
24+
"aiplatform/test_cloud_profiler.py",
25+
"aiplatform/test_uploader.py",
26+
"aiplatform/test_uploader_main.py",
27+
"aiplatform/test_autologging.py",
28+
"aiplatform/test_explain_lit.py",
29+
"aiplatform/test_explain_saved_model_metadata_builder_tf2_test.py",
30+
"aiplatform/test_metadata_models.py",
31+
"aiplatform/test_endpoints.py",
32+
"aiplatform/test_model_evaluation.py",
33+
"aiplatform/test_models.py",
34+
"aiplatform/test_utils.py",
35+
"vertexai/test_reasoning_engines.py",
36+
"vertexai/test_model_utils.py",
37+
"vertexai/test_remote_training.py",
38+
"vertexai/test_serializers.py",
39+
"vertexai/test_vizier_hyperparameter_tuner.py",
40+
]

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.