Skip to content

Commit b84ea03

Browse files
committed
DOC: comment in windows bat, rewrite docstring
Comment to help reader of windows bat wrapper. Point readers to discussion of installation and bat files.
1 parent 9c3bff7 commit b84ea03

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

setup_helpers.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def generate_a_pyrex_source(self, base, ext_name, source, extension):
300300

301301
BAT_TEMPLATE = \
302302
r"""@echo off
303+
REM wrapper to use shebang first line of {FNAME}
303304
set mypath=%~dp0
304305
set pyscript="%mypath%{FNAME}"
305306
set /p line1=<%pyscript%
@@ -316,27 +317,17 @@ class install_scripts_nipy(install_scripts):
316317
317318
Scripts are bare file names without extension on Unix, fitting (for example)
318319
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.
322324
323325
Notes
324326
-----
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.
340331
"""
341332
def run(self):
342333
install_scripts.run(self)

0 commit comments

Comments
 (0)