@@ -69,16 +69,21 @@ def build_extension(self, ext):
6969
7070 ext .library_dirs .append (os .path .join (current_dir , self .build_lib , 'snowflake' , 'connector' ))
7171 ext .extra_link_args += self ._get_arrow_lib_as_linker_input ()
72- ext .extra_link_args += ['-Wl,-rpath,$ORIGIN' ]
72+
73+ if self ._is_unix ():
74+ ext .extra_link_args += ['-Wl,-rpath,$ORIGIN' ]
7375
7476 build_ext .build_extension (self , ext )
7577
78+ def _is_unix (self ):
79+ return platform .startswith ('linux' ) or platform == 'darwin'
80+
7681 def _get_arrow_lib_dir (self ):
7782 return pyarrow .get_library_dirs ()[0 ]
7883
7984 def _copy_arrow_lib (self ):
80- arrow_lib = pyarrow . get_libraries () + \
81- [ 'arrow_flight' , 'arrow_boost_regex' , 'arrow_boost_system' , 'arrow_boost_filesystem' ]
85+ arrow_lib = self . _get_libs_to_copy ()
86+
8287 for lib in arrow_lib :
8388 lib_pattern = self ._get_pyarrow_lib_pattern (lib )
8489 source = glob .glob (lib_pattern )[0 ]
@@ -94,11 +99,22 @@ def _get_arrow_lib_as_linker_input(self):
9499
95100 return link_lib
96101
102+ def _get_libs_to_copy (self ):
103+ if self ._is_unix ():
104+ return pyarrow .get_libraries () + \
105+ ['arrow_flight' , 'arrow_boost_regex' , 'arrow_boost_system' , 'arrow_boost_filesystem' ]
106+ elif platform == 'win32' :
107+ return pyarrow .get_libraries () + ['arrow_flight' ]
108+ else :
109+ raise RuntimeError ('Building on platform {} is not supported yet.' .format (platform ))
110+
97111 def _get_pyarrow_lib_pattern (self , lib_name ):
98112 if platform .startswith ('linux' ):
99113 return '{}/lib{}.so*' .format (self ._get_arrow_lib_dir (), lib_name )
100114 elif platform == 'darwin' :
101115 return '{}/lib{}*dylib' .format (self ._get_arrow_lib_dir (), lib_name )
116+ elif platform == 'win32' :
117+ return '{}\\ {}.lib' .format (self ._get_arrow_lib_dir (), lib_name )
102118 else :
103119 raise RuntimeError ('Building on platform {} is not supported yet.' .format (platform ))
104120
@@ -121,7 +137,8 @@ def _get_pyarrow_lib_pattern(self, lib_name):
121137 download_url = 'https://www.snowflake.com/' ,
122138 use_2to3 = False ,
123139
124- python_requires = '>=2.7.9,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*' ,
140+ # NOTE: Python 3.4 will be dropped within one month.
141+ python_requires = '>=2.7.9,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*' ,
125142
126143 install_requires = [
127144 'azure-common' ,
0 commit comments