diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-09-16 11:07:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-09-21 13:17:33 +0000 |
commit | 8b484df1cf36cbf43192bc1e4669b5e3dcb591e7 (patch) | |
tree | 86b67b1a493f46ba88e4d523c7c0da6e95bbae78 /setup.py | |
parent | 7a5b8f77391689f50d03a9f94c9d2f0570d340fb (diff) |
setup.py: Prefix build/install directories by virtualenv name
Use testenv_name_build/testenv_name_install instead of
pyside_build_install when a virtual environment exists.
This makes it easier to maintain builds in varying
environments in parallel for comparing things.
Change-Id: I33f672a24d871ccb8c9aad1614b7b3eded33b93c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -280,6 +280,14 @@ if OPTION_NOEXAMPLES: if item[0].startswith('pyside2-examples'): del submodules[__version__][idx] +# Return a prefix suitable for the _install/_build directory +def prefix(): + virtualEnvName = os.environ['VIRTUAL_ENV'] + name = os.path.basename(virtualEnvName) if virtualEnvName is not None else 'pyside' + name += str(sys.version_info[0]) + if OPTION_DEBUG: + name += 'd' + return name # Initialize, pull and checkout submodules def prepareSubModules(): @@ -551,8 +559,8 @@ class pyside_build(_build): script_dir = os.getcwd() sources_dir = os.path.join(script_dir, "sources") - build_dir = os.path.join(script_dir, "pyside_build", "%s" % build_name) - install_dir = os.path.join(script_dir, "pyside_install", "%s" % build_name) + build_dir = os.path.join(script_dir, prefix() + '_build', "%s" % build_name) + install_dir = os.path.join(script_dir, prefix() + '_install', "%s" % build_name) # Try to ensure that tools built by this script (such as shiboken2) # are found before any that may already be installed on the system. |