[issue14027] distutils2 lack of pysetup.bat

Éric Araujo report at bugs.python.org
Mon Feb 20 02:22:07 CET 2012


Éric Araujo <merwok at netwok.org> added the comment:

[Paul]
> %~dp0\..\python.exe locates python relative to the batch file (one directory up) so will work as long
> as the bat file is in Scripts. The @ just suppresses echo of the command.

Okay, so a pysetup.bat script installed by pythonX.Y.exe will be put in that Python’s Scripts directory and will call that Python when invoked.  Sounds good.

>> - Aren’t there issues with .bat scripts (or maybe it’s with .com scripts, I never remember)?
> Yes. They don't nest, so to invoke pysetup in a batch file, you need to write "call pysetup.bat". If
> you just use "pysetup", the command never returns causing silent failures. Personally, I hate bat files
> for this reason alone, but others seem happy to put up with them.

Noted.  (I’ve been reading old mailing list archives and found this sort of criticism in bat vs. com discussions.)

>> - Shouldn’t we install a pysetup.py script instead?
> That would be better, in my view.

Okay, I can do this for the short term.  勇刚.罗 (sorry if that does not read right, I seem to have font problems), would that satisfy you?

>> - Shouldn’t we generate an .exe file instead (see #12394)?
> exe files probably give the best user experience, but are opaque which is mildly annoying. Also, test
> very carefully on Win7. I have a vague recollection that exes with setup and/or install in the names
> invoke UAC, which is a complete pain. easy_install suffers from this, I believe.

Oh dear, what an horror story.  I really wish we won’t have to rename pysetup, it’s the only generic and available name we could agree on.

> Personally, "python -m packaging.run" works fine for me. I'd prefer not to have a pysetup command at
> all, and change the documentation to refer to the python -m form throughout. Second best would be an exe,
> third would be pysetup.py (but again, the docs need changing), and finally a bat file.

Thanks for the feedback.  I don’t think we’re going to move away from a main script; we’re making packaging more useful and more robust, and having a script is IMO a message as well as a convenience.


[Vinay]
> After that, I agree with Paul's ordering of .exe, with the setup script having to be named
> pysetup-script.py if we use the "standard" mechanism, or else if we use a custom .exe, it can of course
> be called whatever we want.

I don’t understand the notions of standard vs. custom.  Does standard mean setuptools?  #12394 is not quite ready yet, so nothing is set in stone, but if possible I’d prefer to generate pysetup.exe.  Let’s move the sub-discussion there.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14027>
_______________________________________


More information about the Python-bugs-list mailing list