aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-11-24 15:30:17 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-11-24 15:30:17 -0500
commita37fa9563065819a8520b1a7c501949a5a5d8df4 (patch)
tree234fe8d0b2f9e0b7591f3a84e361f6a0a0a0a7aa /setup.py
parenta2062b812cbf41ac6666975d05ab8c79de723d10 (diff)
downloadexternal_python_setuptools-a37fa9563065819a8520b1a7c501949a5a5d8df4.tar.gz
external_python_setuptools-a37fa9563065819a8520b1a7c501949a5a5d8df4.tar.bz2
external_python_setuptools-a37fa9563065819a8520b1a7c501949a5a5d8df4.zip
Updated environment-specific console script generation to use modern style.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 50d0e4c5..6cf52521 100755
--- a/setup.py
+++ b/setup.py
@@ -31,14 +31,23 @@ from setuptools.command.test import test as _test
scripts = []
-console_scripts = ["easy_install = setuptools.command.easy_install:main"]
-
-# Gentoo distributions manage the python-version-specific scripts themselves,
-# so they define an environment variable to suppress the creation of the
-# version-specific scripts.
-if os.environ.get("SETUPTOOLS_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT") in (None, "", "0") and \
- os.environ.get("DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT") in (None, "", "0"):
- console_scripts.append("easy_install-%s = setuptools.command.easy_install:main" % sys.version[:3])
+def _gen_console_scripts():
+ yield "easy_install = setuptools.command.easy_install:main"
+
+ # Gentoo distributions manage the python-version-specific scripts
+ # themselves, so those platforms define an environment variable to
+ # suppress the creation of the version-specific scripts.
+ var_names = (
+ 'SETUPTOOLS_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',
+ 'DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',
+ )
+ if any(os.environ.get(var) not in (None, "", "0") for var in var_names):
+ return
+ yield ("easy_install-{shortver} = setuptools.command.easy_install:main"
+ .format(shortver=sys.version[:3]))
+
+console_scripts = list(_gen_console_scripts())
+
# specific command that is used to generate windows .exe files
class build_py(_build_py):