File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env python
2
+ """Helper script to be run by `cibuildwheel` as `before_all` step."""
3
+
4
+ import os
5
+ import sys
6
+
7
+ HERE = os .path .abspath (__file__ )
8
+ ROOT = os .path .dirname (os .path .dirname (os .path .dirname (HERE )))
9
+ sys .path .insert (0 , os .path .join (ROOT , "packages" , "basemap" ))
10
+ import utils # noqa: E402 # pylint: disable=imports
11
+
12
+
13
+ def main ():
14
+ """Build the GEOS library based on parsed environment variables."""
15
+
16
+ geos_version = os .environ .get ("GEOS_VERSION" , None )
17
+ if geos_version is None :
18
+ raise ValueError ("Undefined environment variable GEOS_VERSION" )
19
+
20
+ geos_dir = os .environ .get ("GEOS_DIR" , None )
21
+ if geos_dir is None :
22
+ raise ValueError ("Undefined environment variable GEOS_DIR" )
23
+
24
+ geos_njobs = int (os .environ .get ("GEOS_NJOBS" , 1 ))
25
+
26
+ # pylint: disable=consider-using-f-string
27
+ print ("Running before_all script with the following settings:" )
28
+ print ("GEOS_DIR: {0}" .format (geos_dir ))
29
+ print ("GEOS_VERSION: {0}" .format (geos_version ))
30
+ print ("GEOS_NJOBS: {0}" .format (geos_njobs ))
31
+
32
+ utils .GeosLibrary (geos_version ).build (geos_dir , njobs = geos_njobs )
33
+ return 0
34
+
35
+
36
+ if __name__ == "__main__" :
37
+ sys .exit (main ())
You can’t perform that action at this time.
0 commit comments