@@ -300,6 +300,7 @@ def generate_a_pyrex_source(self, base, ext_name, source, extension):
300
300
301
301
BAT_TEMPLATE = \
302
302
r"""@echo off
303
+ REM wrapper to use shebang first line of {FNAME}
303
304
set mypath=%~dp0
304
305
set pyscript="%mypath%{FNAME}"
305
306
set /p line1=<%pyscript%
@@ -316,27 +317,17 @@ class install_scripts_nipy(install_scripts):
316
317
317
318
Scripts are bare file names without extension on Unix, fitting (for example)
318
319
Debian rules. They identify as python scripts with the usual ``#!`` first
319
- line. This doesn't work on Windows. So, on Windows only we ad a ``.bat``
320
- wrapper of name ``bare_script_name.bat`` to call ``bare_script_name``
321
- using the python interpreter from the #! first line of the script.
320
+ line. Unix recognizes and uses this first "shebang" line, but Windows does
321
+ not. So, on Windows only we add a ``.bat`` wrapper of name
322
+ ``bare_script_name.bat`` to call ``bare_script_name`` using the python
323
+ interpreter from the #! first line of the script.
322
324
323
325
Notes
324
326
-----
325
- The idea for this routine came from an idea in Twisted, re-used in IPython
326
-
327
- An alternative to this method would be to use the ``distribute`` /
328
- ``setuptools`` ``cli.exe`` method. We could do this by defining console
329
- entry points for the scripts, and moving the script code into the libary.
330
- setuptools then copies a pre-compiled Windows executable ``cli.exe`` as
331
- ``bare_script_name.exe``, and the script as ``bare_script_name-script.py``.
332
- The executable file ``cli.exe`` (copied as ``bare_script_name.exe``)
333
- analyzes its own name, and then calls ``bare_script_name-script.py`` with
334
- the Python interpreter named in the top line of the script file. Doing this
335
- induces a run-time dependency on setuptools because the generated python
336
- script files import ``pkg_resources``.
337
-
338
- See git://github.com/matthew-brett/myscripter.git for some experiments to
339
- show what setuptools and distutils are doing.
327
+ See discussion at
328
+ http://matthew-brett.github.com/pydagogue/installing_scripts.html and
329
+ example at git://github.com/matthew-brett/myscripter.git for more
330
+ background.
340
331
"""
341
332
def run (self ):
342
333
install_scripts .run (self )
0 commit comments