aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-17 10:44:18 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-08-17 10:44:18 -0400
commit2473aa6da27cb95c1582aee1bb188f76e0deb258 (patch)
treec2f629003de2b9114e9b9facf71049e78c7aca84
parent3eb3c69afbe1d2ebbc98943a896ccbfc913113c1 (diff)
downloadexternal_python_setuptools-2473aa6da27cb95c1582aee1bb188f76e0deb258.tar.gz
external_python_setuptools-2473aa6da27cb95c1582aee1bb188f76e0deb258.tar.bz2
external_python_setuptools-2473aa6da27cb95c1582aee1bb188f76e0deb258.zip
Changed the launcher relevant environment variable to SETUPTOOLS_LAUNCHER and it now accepts different strings 'natural' and 'executable', instead of only reflecting a boolean value.
-rw-r--r--CHANGES.txt6
-rw-r--r--docs/easy_install.txt8
-rwxr-xr-xsetuptools/command/easy_install.py16
3 files changed, 17 insertions, 13 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index db9c637c..b2e26770 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,9 +10,11 @@ CHANGES
<https://bitbucket.org/pypa/pylauncher>`_ (included with Python 3.3) to
launch console and GUI scripts and not install its own launcher
executables. This experimental functionality is currently only enabled if
- the ``SETUPTOOLS_USE_PYLAUNCHER`` environment variable is set (to anything).
+ the ``SETUPTOOLS_LAUNCHER`` environment variable is set to "natural".
In the future, this behavior may become default, but only after it has
- matured and seen substantial adoption.
+ matured and seen substantial adoption. The ``SETUPTOOLS_LAUNCHER`` also
+ accepts "executable" to force the default behavior of creating launcher
+ executables.
* Issue #63: Bootstrap script (ez_setup.py) now prefers Powershell, curl, or
wget for retrieving the Setuptools tarball for improved security of the
install. The script will still fall back to a simple ``urlopen`` on
diff --git a/docs/easy_install.txt b/docs/easy_install.txt
index 03f816de..744b4967 100644
--- a/docs/easy_install.txt
+++ b/docs/easy_install.txt
@@ -98,12 +98,14 @@ can pass command line options (such as ``--script-dir``) to
Setuptools also supports deferring to an external launcher such as
`pylauncher <https://bitbucket.org/pypa/pylauncher>`_ for launching scripts.
Enable this experimental functionality by setting the
-``SETUPTOOLS_USE_PYLAUNCHER`` environment variable. Setuptools will then not
+``SETUPTOOLS_LAUNCHER`` environment variable to "natural". Setuptools will
+then not
install its own launcher executable, but will install scripts as simple
-scripts with a .py (or .pyw) extension appended. If these extensions are
+scripts with a .pya (or .pyw) extension appended. If these extensions are
associated with the pylauncher and listed in the PATHEXT environment variable,
these scripts can then be invoked simply and directly just like any other
-executable.
+executable. This behavior may become default in a future version. To force
+the use of executable launchers, set ``SETUPTOOLS_LAUNCHER`` to "executable".
Downloading and Installing a Package
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index cf4402a5..19d6e494 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1834,13 +1834,13 @@ class WindowsScriptWriter(ScriptWriter):
"""
Get a script writer suitable for Windows
"""
- # for compatibility, return the writer that creates exe launchers
- # unless the SETUPTOOLS_USE_PYLAUNCHER is set, indicating
- # future behavior.
- use_legacy = 'SETUPTOOLS_USE_PYLAUNCHER' not in os.environ
- if use_legacy:
- return WindowsLauncherScriptWriter
- return cls
+ writer_lookup = dict(
+ executable=WindowsExecutableLauncherWriter,
+ natural=cls,
+ )
+ # for compatibility, use the executable launcher by default
+ launcher = os.environ.get('SETUPTOOLS_LAUNCHER', 'executable')
+ return writer_lookup[launcher]
@classmethod
def _get_script_args(cls, type_, name, header, script_text):
@@ -1874,7 +1874,7 @@ class WindowsScriptWriter(ScriptWriter):
return new_header
-class WindowsLauncherScriptWriter(WindowsScriptWriter):
+class WindowsExecutableLauncherWriter(WindowsScriptWriter):
@classmethod
def _get_script_args(cls, type_, name, header, script_text):
"""