Commit e7f9dab0 authored by Jason R. Coombs's avatar Jason R. Coombs

Add 'launch' hook, based on pip.utils.setuptools_build

parent 3b7b733c
...@@ -2,6 +2,21 @@ ...@@ -2,6 +2,21 @@
CHANGES CHANGES
======= =======
19.6
----
* Added a new entry script ``setuptools.launch``,
implementing the shim found in
``pip.util.setuptools_build``. Use this command to launch
distutils-only packages under setuptools in the same way that
pip does, causing the setuptools monkeypatching of distutils
to be invoked prior to invoking a script. Useful for debugging
or otherwise installing a distutils-only package under
setuptools when pip isn't available or otherwise does not
expose the desired functionality. For example::
$ python -m setuptools.launch setup.py develop
19.5 19.5
---- ----
......
"""
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def load():
"""
Load the script in sys.argv[1] and run it as if it had
been invoked naturally.
"""
globals()['__file__'] = sys.argv[1]
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(__file__).read()
norm_script = script.replace('\\r\\n', '\\n')
return compile(norm_script, __file__, 'exec')
if __name__ == '__main__':
exec(load())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment