diff options
Diffstat (limited to 'python/SConscript')
| -rw-r--r-- | python/SConscript | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/python/SConscript b/python/SConscript new file mode 100644 index 0000000..416ff9f --- /dev/null +++ b/python/SConscript @@ -0,0 +1,24 @@ +Import('*') +# describe what we need for Python + +EnsurePythonVersion(2, 4) + +import distutils.sysconfig +import os.path + +# distutils default prefix is the common path between +# distutils.sysconfig.get_python_lib and distutils.sysconfig.get_python_inc +prefix = os.path.commonprefix([ + distutils.sysconfig.get_python_lib(), + distutils.sysconfig.get_python_inc(), + ]) +# suffix to install .py files to is distutils.sysconfig.get_python_lib() +# after the common prefix +python_suffix = distutils.sysconfig.get_python_lib()[len(prefix):] +# install path for python is then in DESTDIR + python_suffix +python_installdir = DESTDIR + python_suffix + '/subunit' +env.Alias('install', [Install(python_installdir, 'subunit/__init__.py')]) +# tests +tests = [] +tests.append(env.TestPython('check_python', 'test_python.py', PYTHONPATH='python')) +env.Alias('check', tests) |
