From 34cffd0135bbaa80abcbcac8156332eadcab9f09 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 19 Apr 2012 16:45:15 +0000 Subject: [PATCH] Fixed issues generating version-dependent installer for Windows Python module Passing the '--target-version' option to bdist_msi will generate an installer that requires the right version of Python without distutils needing to be able to find a working compiler. --- interfaces/python/setup.py.in | 5 ++--- src/python/SConscript | 7 ++----- src/python/spam.c | 13 ------------- 3 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 src/python/spam.c diff --git a/interfaces/python/setup.py.in b/interfaces/python/setup.py.in index de3ebbb6b..3ea1d59ff 100644 --- a/interfaces/python/setup.py.in +++ b/interfaces/python/setup.py.in @@ -17,8 +17,7 @@ if '@python_package@' == 'full': url="http://code.google.com/p/cantera", packages = ["","Cantera","Cantera.OneD", "MixMaster","MixMaster.Units"], - package_data = {'Cantera': dataFiles}, - ext_modules=[Extension('_spam', [@spam_source@])]) + package_data = {'Cantera': dataFiles}) elif '@python_package@' == 'minimal': setup(name="Cantera CTI File Processor", @@ -28,5 +27,5 @@ elif '@python_package@' == 'minimal': """, author="Prof. D. G. Goodwin, Caltech", author_email="dgoodwin@caltech.edu", - url="http://www.cantera.org", + url="http://code.google.com/p/cantera", py_modules = ["ctml_writer"]) diff --git a/src/python/SConscript b/src/python/SConscript index ec188f9de..fc90bd3d9 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -85,16 +85,13 @@ else: # Install Python module in the default location extra = '' -if 'MSSdk' in os.environ: - localenv['ENV']['DISTUTILS_USE_SDK'] = '1' - localenv['ENV']['MSSdk'] = os.environ['MSSdk'] - if localenv['PYTHON_INSTALLER'] == 'direct': install(localenv.Command, 'dummy', pymodule, 'cd %s && $python_cmd setup.py install %s' % (moddir,extra)) elif localenv['PYTHON_INSTALLER'] == 'binary': install(localenv.Command, 'dummy', pymodule, - 'cd %s && $python_cmd setup.py bdist_msi --dist-dir=../..' % moddir) + 'cd %s && $python_cmd setup.py bdist_msi --dist-dir=../..' % moddir + + ' --target-version=' + distutils.sysconfig.get_python_version()) if localenv['python_package'] == 'full': install(localenv.RecursiveInstall, pjoin('$inst_sampledir', 'python'), diff --git a/src/python/spam.c b/src/python/spam.c deleted file mode 100644 index 972b2900d..000000000 --- a/src/python/spam.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * A trivial Python extension module introduced to force distutils to - * generate installation packages requiring a specific Python version. - */ - -#include - -PyMODINIT_FUNC -init_spam(void) -{ - Py_InitModule3("_spam", NULL, - "Spam, spam, spam, eggs, and spam."); -}