66
77"""
88
9+ import builtins
910import os
1011import sys
1112import subprocess
1617except ImportError :
1718 import ConfigParser as configparser
1819
19- if sys .version_info [0 ] >= 3 :
20- import builtins
21- else :
22- import __builtin__ as builtins
23-
2420try :
2521 from skbuild import setup
2622 from skbuild .command .sdist import sdist
2723except ImportError :
2824 raise ImportError ('scikit-build must be installed before running setup.py' )
2925
30- if sys .version_info [: 2 ] < ( 2 , 7 ) or ( 3 , 0 ) <= sys . version_info [ 0 :2 ] < (3 , 5 ):
31- raise RuntimeError ("Python version 2.7 or >= 3.5 required." )
26+ if sys .version_info [0 :2 ] < (3 , 6 ):
27+ raise RuntimeError ("Python version >= 3.6 required." )
3228
3329DOCLINES = __doc__ .split ("\n " )
3430
4137Programming Language :: C
4238Programming Language :: Fortran
4339Programming Language :: Python
44- Programming Language :: Python :: 2
45- Programming Language :: Python :: 3
40+ Programming Language :: Python :: 3.6
41+ Programming Language :: Python :: 3.7
42+ Programming Language :: Python :: 3.8
43+ Programming Language :: Python :: 3.9
4644Topic :: Software Development
4745Topic :: Scientific/Engineering
4846Operating System :: Microsoft :: Windows
@@ -190,35 +188,6 @@ def get_version_info(srcdir=None):
190188 return FULLVERSION , GIT_REVISION
191189
192190
193- def check_submodules ():
194- """ verify that the submodules are checked out and clean
195- use `git submodule update --init`; on failure
196- """
197- if not os .path .exists ('.git' ):
198- return
199- with open ('.gitmodules' ) as f :
200- for l in f :
201- if 'path' in l :
202- p = l .split ('=' )[- 1 ].strip ()
203- if not os .path .exists (p ):
204- raise ValueError ('Submodule %s missing' % p )
205-
206- proc = subprocess .Popen (['git' , 'submodule' , 'status' ],
207- stdout = subprocess .PIPE )
208- status , _ = proc .communicate ()
209- status = status .decode ("ascii" , "replace" )
210- for line in status .splitlines ():
211- if line .startswith ('-' ) or line .startswith ('+' ):
212- raise ValueError ('Submodule not clean: %s' % line )
213-
214-
215- class sdist_checked (sdist ):
216- """ check submodules on sdist to prevent incomplete tarballs """
217- def run (self ):
218- # slycot had no submodules currently
219- # check_submodules()
220- sdist .run (self )
221-
222191
223192def setup_package ():
224193 src_path = os .path .dirname (os .path .abspath (__file__ ))
@@ -241,7 +210,6 @@ def setup_package():
241210 license = 'GPL-2.0' ,
242211 classifiers = [_f for _f in CLASSIFIERS .split ('\n ' ) if _f ],
243212 platforms = ["Windows" , "Linux" , "Solaris" , "Mac OS-X" , "Unix" ],
244- cmdclass = {"sdist" : sdist_checked },
245213 cmake_args = ['-DSLYCOT_VERSION:STRING=' + VERSION ,
246214 '-DGIT_REVISION:STRING=' + gitrevision ,
247215 '-DISRELEASE:STRING=' + str (ISRELEASED ),
@@ -250,40 +218,6 @@ def setup_package():
250218 install_requires = ['numpy' ],
251219 )
252220
253- # Windows builds use Flang.
254- # Flang detection and configuration is not automatic yet; the CMAKE
255- # settings below are to circumvent that; when scikit-build and cmake
256- # tools have improved, most of this might be removed?
257- if platform .system () == 'Windows' :
258-
259- pbase = r'/' .join (sys .executable .split (os .sep )[:- 1 ])
260- env2cmakearg = {
261- 'FC' : ('-DCMAKE_Fortran_COMPILER=' ,
262- pbase + r'/Library/bin/flang.exe' ),
263- 'F2PY' : ('-DF2PY_EXECUTABLE=' ,
264- pbase + r'/Scripts/f2py.exe' ),
265- 'NUMPY_INCLUDE' : ('-DNumPy_INCLUDE_DIR=' ,
266- pbase + r'/Include' )
267- }
268-
269- metadata ['cmake_args' ].extend (['-GNMake Makefiles' ])
270-
271- for k , v in env2cmakearg .items ():
272- print (k , v , os .environ .get (k , '' ))
273- envval = os .environ .get (k , None )
274- if envval :
275- # get from environment
276- metadata ['cmake_args' ].append (
277- v [0 ] + envval .replace ('\\ ' , '/' ))
278- else :
279- # default
280- metadata ['cmake_args' ].append (v [0 ] + v [1 ])
281-
282- metadata ['cmake_args' ].extend ([
283- '-DCMAKE_Fortran_SIMULATE_VERSION=5.0.0' ,
284- '-DCMAKE_Fortran_COMPILER_ID=Flang' ,
285- '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' ])
286- print (metadata ['cmake_args' ])
287221 try :
288222 setup (** metadata )
289223 finally :
0 commit comments