3131
3232
3333def gitinfo ():
34- from subprocess import Popen , PIPE
34+ from subprocess import Popen , PIPE , check_output
3535 kw = dict (stdout = PIPE , cwd = MYDIR , universal_newlines = True )
3636 proc = Popen (['git' , 'describe' , '--tags' , '--match=v[[:digit:]]*' ], ** kw )
3737 desc = proc .stdout .read ()
3838 proc = Popen (['git' , 'log' , '-1' , '--format=%H %ct %ci' ], ** kw )
3939 glog = proc .stdout .read ()
4040 rv = {}
41- rv ['version' ] = '.post' .join (desc .strip ().split ('-' )[:2 ]).lstrip ('v' )
4241 rv ['commit' ], rv ['timestamp' ], rv ['date' ] = glog .strip ().split (None , 2 )
42+ version = check_output (['git' , 'tag' ]).decode ('ascii' ).strip ()
43+ rv ['version' ] = version
4344 return rv
4445
4546
@@ -66,6 +67,7 @@ def getversioncfg():
6667 except OSError :
6768 pass
6869 # finally, check and update the active version file
70+
6971 cp = RawConfigParser ()
7072 cp .read (versioncfgfile )
7173 d = cp .defaults ()
@@ -123,11 +125,27 @@ def get_gsl_config():
123125 rv ['library_dirs' ] += [lib ]
124126 return rv
125127
128+ def get_gsl_config_win ():
129+ '''Return dictionary with paths to GSL library, windwows version.
130+ This version is installed with conda.
131+ '''
132+ conda_prefix = os .environ ['CONDA_PREFIX' ]
133+ inc = os .path .join (conda_prefix , 'Library' , 'include' )
134+ lib = os .path .join (conda_prefix , 'Library' , 'lib' )
135+ rv = {'include_dirs' : [], 'library_dirs' : []}
136+ rv ['include_dirs' ] += [inc ]
137+ rv ['library_dirs' ] += [lib ]
138+ return rv
139+
126140# ----------------------------------------------------------------------------
127141
128142# compile and link options
129143define_macros = []
130- gcfg = get_gsl_config ()
144+ os_name = os .name
145+ if os_name == 'nt' :
146+ gcfg = get_gsl_config_win ()
147+ else :
148+ gcfg = get_gsl_config ()
131149include_dirs = [MYDIR ] + gcfg ['include_dirs' ]
132150library_dirs = []
133151libraries = []
0 commit comments