From 4ff83274f7a9c20297c3484e994ba584c1771b31 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Mon, 17 Apr 2006 14:13:35 +1000 Subject: Finish stage one conversion to scons. --- python/SConscript | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 python/SConscript (limited to 'python/SConscript') 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) -- cgit v1.2.1