55"""
66
77import os , sys , math , codecs
8- from distutils .cmd import Command
9- from distutils .command .build_ext import build_ext
10- from distutils .command .build import build
11- from distutils .ccompiler import get_default_compiler
12- try :
13- from setuptools import setup , Extension
14- except :
8+ if sys .version_info < (3 ,10 ):
9+ from distutils .cmd import Command
10+ from distutils .command .build_ext import build_ext
11+ from distutils .command .build import build
12+ from distutils .ccompiler import get_default_compiler
1513 from distutils .core import setup , Extension
16- from distutils import sysconfig
14+ from distutils import sysconfig
15+ else :
16+ from setuptools import Command
17+ from setuptools .command .build_ext import build_ext
18+ from setuptools .command .build import build
19+ from setuptools ._distutils .ccompiler import get_default_compiler
20+ from setuptools import setup , Extension
1721
1822class test (Command ):
1923 # Original version of this class posted
@@ -68,22 +72,13 @@ def run(self):
6872 qle_swig_dir = os .path .join ("QuantExt-SWIG" ,"SWIG" )
6973 oredata_swig_dir = os .path .join ("OREData-SWIG" ,"SWIG" )
7074 orea_swig_dir = os .path .join ("OREAnalytics-SWIG" ,"SWIG" )
71- if sys .version_info .major >= 3 :
72- os .system ('swig -python -c++ ' +
73- '-I%s ' % ql_swig_dir +
74- '-I%s ' % qle_swig_dir +
75- '-I%s ' % oredata_swig_dir +
76- '-I%s ' % orea_swig_dir +
77- '-o oreanalytics_wrap.cpp ' +
78- os .path .join ("OREAnalytics-SWIG" ,"SWIG" ,"oreanalytics.i" ))
79- else :
80- os .system ('swig -python -c++ ' +
81- '-I%s ' % ql_swig_dir +
82- '-I%s ' % qle_swig_dir +
83- '-I%s ' % oredata_swig_dir +
84- '-I%s ' % orea_swig_dir +
85- '-o oreanalytics_wrap.cpp ' +
86- os .path .join ("OREAnalytics-SWIG" ,"SWIG" ,"oreanalytics.i" ))
75+ os .system ('swig -python -c++ ' +
76+ '-I%s ' % ql_swig_dir +
77+ '-I%s ' % qle_swig_dir +
78+ '-I%s ' % oredata_swig_dir +
79+ '-I%s ' % orea_swig_dir +
80+ '-o oreanalytics_wrap.cpp ' +
81+ os .path .join ("OREAnalytics-SWIG" ,"SWIG" ,"oreanalytics.i" ))
8782
8883class my_build (build ):
8984 user_options = build .user_options + [
@@ -264,13 +259,6 @@ def finalize_options(self):
264259
265260datafiles = []
266261
267- # patch distutils if it can't cope with the "classifiers" or
268- # "download_url" keywords
269- if sys .version < '2.2.3' :
270- from distutils .dist import DistributionMetadata
271- DistributionMetadata .classifiers = None
272- DistributionMetadata .download_url = None
273-
274262classifiers = [
275263 'Development Status :: 5 - Production/Stable' ,
276264 'Environment :: Console' ,
@@ -297,7 +285,7 @@ def finalize_options(self):
297285 """ ,
298286 author = "Quaternion Risk Management" ,
299287 author_email = "info@quaternion.com" ,
300- url = "http://quaternion.com " ,
288+ url = "http://opensourcerisk.org/ " ,
301289 license = codecs .open ('LICENSE.txt' ,'r+' ,
302290 encoding = 'utf8' ).read (),
303291 classifiers = classifiers ,
0 commit comments