Skip to content

Commit c7dc5ab

Browse files
authored
SNOW-900365: update cloudpickle dep for python 3.11 support (#1044)
1 parent 3946048 commit c7dc5ab

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

setup.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,30 @@
1111
SRC_DIR = os.path.join(THIS_DIR, "src")
1212
SNOWPARK_SRC_DIR = os.path.join(SRC_DIR, "snowflake", "snowpark")
1313
CONNECTOR_DEPENDENCY_VERSION = ">=3.2.0, <4.0.0"
14+
INSTALL_REQ_LIST = [
15+
"setuptools>=40.6.0",
16+
"wheel",
17+
f"snowflake-connector-python{CONNECTOR_DEPENDENCY_VERSION}",
18+
"pyyaml",
19+
]
20+
CLOUDPICKLE_REQ_LIST = ["cloudpickle>=1.6.0,<=2.0.0"]
1421
REQUIRED_PYTHON_VERSION = ">=3.8, <3.11"
22+
1523
if os.getenv("SNOWFLAKE_IS_PYTHON_RUNTIME_TEST", False):
24+
# this allows us to update the cloudpickle dependency by env var when building package privately
25+
# without re-releasing package just to update the dependency, example if we want to lower cloudpickle dep to 2.1.0:
26+
# SNOWFLAKE_IS_PYTHON_RUNTIME_TEST=1 CLOUDPICKLE_PYTHON_311_DEPENDENCY="cloudpickle==2.1.0;python_version~='3.11'" pip install .
27+
CLOUDPICKLE_PYTHON_311_DEPENDENCY = os.getenv(
28+
"CLOUDPICKLE_PYTHON_311_DEPENDENCY",
29+
"cloudpickle==2.2.1;python_version~='3.11'",
30+
)
1631
REQUIRED_PYTHON_VERSION = ">=3.8"
32+
CLOUDPICKLE_REQ_LIST = [
33+
"cloudpickle>=1.6.0,<=2.0.0;python_version<'3.11'",
34+
CLOUDPICKLE_PYTHON_311_DEPENDENCY,
35+
]
36+
37+
INSTALL_REQ_LIST.extend(CLOUDPICKLE_REQ_LIST)
1738

1839
# read the version
1940
VERSION = ()
@@ -46,13 +67,7 @@
4667
"Changelog": "https://github.com/snowflakedb/snowpark-python/blob/main/CHANGELOG.md",
4768
},
4869
python_requires=REQUIRED_PYTHON_VERSION,
49-
install_requires=[
50-
"setuptools>=40.6.0",
51-
"wheel",
52-
"cloudpickle>=1.6.0,<=2.0.0",
53-
f"snowflake-connector-python{CONNECTOR_DEPENDENCY_VERSION}",
54-
"pyyaml",
55-
],
70+
install_requires=INSTALL_REQ_LIST,
5671
namespace_packages=["snowflake"],
5772
# When a new package (directory) is added, we should also add it here
5873
packages=[

0 commit comments

Comments
 (0)