diff options
author | Reinout van Rees <reinout@vanrees.org> | 2009-10-13 13:28:17 +0200 |
---|---|---|
committer | Reinout van Rees <reinout@vanrees.org> | 2009-10-13 13:28:17 +0200 |
commit | 3bd277147c3c3a8342dbc3b3d51214d430049a6b (patch) | |
tree | 879c797cf4fb86701db59893f676301a129c9f3c /setup.py | |
parent | 7ed4be906cc7195c4d15bdd7a8b2bfa8474cc6be (diff) | |
download | external_python_setuptools-3bd277147c3c3a8342dbc3b3d51214d430049a6b.tar.gz external_python_setuptools-3bd277147c3c3a8342dbc3b3d51214d430049a6b.tar.bz2 external_python_setuptools-3bd277147c3c3a8342dbc3b3d51214d430049a6b.zip |
Detecting buildout by looking in os.environ['_'] to see if it is a buildout
command. If that is the case: do not fake setuptools, just let yourself be
installed as a buildout-managed egg.
--HG--
branch : distribute
extra : rebase_source : 03ae13a4b93098ba76b971f26a01070ad47e361a
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -39,6 +39,7 @@ SETUP_COMMANDS = d['__all__'] VERSION = "0.6.5" from setuptools import setup, find_packages +import os import sys scripts = [] @@ -48,7 +49,15 @@ def _easy_install_marker(): return (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and sys.argv[3] == '--dist-dir' and 'egg-dist-tmp-' in sys.argv[-1]) +def _buildout_marker(): + command = os.environ.get('_') + if command: + return 'buildout' in os.path.basename(command) + def _being_installed(): + if _buildout_marker(): + # Installed by buildout, don't mess with a global setuptools. + return False # easy_install marker return 'install' in sys.argv[1:] or _easy_install_marker() |