summaryrefslogtreecommitdiff
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
commit51ed20f17db29a880b983af475d682a2624a9ef7 (patch)
tree5993b6bb794e6a6e4d0c411aa59ae472cbe98691 /setup.py
parent9d475fcdc0293130ca1451b37236899d70fa4f73 (diff)
downloadpython-setuptools-bitbucket-51ed20f17db29a880b983af475d682a2624a9ef7.tar.gz
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):