@@ -71,23 +71,45 @@ class MyBuildExt(build_ext):
7171 # this list should be carefully examined when pyarrow lib is
7272 # upgraded
7373 arrow_libs_to_copy = {
74- "linux" : ["libarrow.so.800" , "libarrow_python.so.800" , "libparquet.so.800" ],
74+ "linux" : [
75+ "libarrow.so.1000" ,
76+ "libarrow_dataset.so.1000" ,
77+ "libarrow_python.so.1000" ,
78+ "libparquet.so.1000" ,
79+ ],
7580 "darwin" : [
76- "libarrow.800.dylib" ,
77- "libarrow_python.800.dylib" ,
78- "libparquet.800.dylib" ,
81+ "libarrow.1000.dylib" ,
82+ "libarrow_dataset.1000.dylib" ,
83+ "libarrow_python.1000.dylib" ,
84+ "libparquet.1000.dylib" ,
85+ ],
86+ "win32" : [
87+ "arrow.dll" ,
88+ "arrow_dataset.dll" ,
89+ "arrow_python.dll" ,
90+ "parquet.dll" ,
7991 ],
80- "win32" : ["arrow.dll" , "arrow_python.dll" , "parquet.dll" ],
8192 }
8293
8394 arrow_libs_to_link = {
84- "linux" : ["libarrow.so.800" , "libarrow_python.so.800" , "libparquet.so.800" ],
95+ "linux" : [
96+ "libarrow.so.1000" ,
97+ "libarrow_dataset.so.1000" ,
98+ "libarrow_python.so.1000" ,
99+ "libparquet.so.1000" ,
100+ ],
85101 "darwin" : [
86- "libarrow.800.dylib" ,
87- "libarrow_python.800.dylib" ,
88- "libparquet.800.dylib" ,
102+ "libarrow.1000.dylib" ,
103+ "libarrow_dataset.1000.dylib" ,
104+ "libarrow_python.1000.dylib" ,
105+ "libparquet.1000.dylib" ,
106+ ],
107+ "win32" : [
108+ "arrow.lib" ,
109+ "arrow_dataset.lib" ,
110+ "arrow_python.lib" ,
111+ "parquet.lib" ,
89112 ],
90- "win32" : ["arrow.lib" , "arrow_python.lib" , "parquet.lib" ],
91113 }
92114
93115 def build_extension (self , ext ):
@@ -126,13 +148,15 @@ def build_extension(self, ext):
126148 ext .include_dirs .append (LOGGING_SRC_DIR )
127149
128150 if sys .platform == "win32" :
151+ if not any ("/std" not in s for s in ext .extra_compile_args ):
152+ ext .extra_compile_args .append ("/std:c++17" )
129153 ext .include_dirs .append (pyarrow .get_include ())
130154 ext .include_dirs .append (numpy .get_include ())
131155 elif sys .platform == "linux" or sys .platform == "darwin" :
132156 ext .extra_compile_args .append ("-isystem" + pyarrow .get_include ())
133157 ext .extra_compile_args .append ("-isystem" + numpy .get_include ())
134158 if "std=" not in os .environ .get ("CXXFLAGS" , "" ):
135- ext .extra_compile_args .append ("-std=c++11 " )
159+ ext .extra_compile_args .append ("-std=c++17 " )
136160 ext .extra_compile_args .append ("-D_GLIBCXX_USE_CXX11_ABI=0" )
137161
138162 ext .library_dirs .append (
@@ -160,9 +184,11 @@ def _get_arrow_lib_dir(self):
160184 def _copy_arrow_lib (self ):
161185 libs_to_bundle = self .arrow_libs_to_copy [sys .platform ]
162186
187+ build_dir = os .path .join (self .build_lib , "snowflake" , "connector" )
188+ os .makedirs (build_dir , exist_ok = True )
189+
163190 for lib in libs_to_bundle :
164191 source = f"{ self ._get_arrow_lib_dir ()} /{ lib } "
165- build_dir = os .path .join (self .build_lib , "snowflake" , "connector" )
166192 copy (source , build_dir )
167193
168194 def _get_arrow_lib_as_linker_input (self ):
0 commit comments