[Distutils] [Numpy-discussion] Proposal: stop supporting 'setup.py install'; start requiring 'pip install .' instead
Nathaniel Smith
njs at pobox.com
Thu Nov 12 19:28:20 EST 2015
On Sun, Nov 8, 2015 at 12:52 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 8 November 2015 at 17:42, Nathaniel Smith <njs at pobox.com> wrote:
>> I'm not sure exactly what's at stake in this terminological/ontological
>> debate, but it certainly is fairly common for developers to have
>> conversations like "thanks for reporting that issue, I think it's fixed in
>> master but can't reproduce myself so can you try 'pip install
>> https://github.com/pydata/patsy/archive/master.zip' and report back whether
>> it helps?"
>
> Well, reviewing this scenario is probably much more useful than the
> endless terminology debates that I seem to be forever starting, so
> thanks for stopping me!
>
> It seems to me that in this situation, optimising rebuild times
> probably isn't too important. The user is likely to only be building
> once or twice, so reusing object files from a previous build isn't
> likely to be a killer benefit.
Sure. And there's no reasonable way to optimize rebuild times anyway
when the input is a remote URL -- it's only when the input is an
on-disk directory that worrying about incremental builds even makes
sense.
> However, if the user does as you asked here, they'd likely be pretty
> surprised (and it'd be a nasty situation for you to debug) if pip
> didn't install what the user asked. In all honesty, You could argue
> that this implies that pip should unconditionally install files
> specified on the command line,
Yes, that is what I do argue :-)
> but I'd suggest that you should
> actually be asking the user to run 'pip install --ignore-installed
> https://github.com/pydata/patsy/archive/master.zip'. That avoids any
> risk that whatever the user has currently installed could mess things
> up, and is explicit that it's doing so (and equally, it's explicit
> that it'll overwrite the currently installed version, which the user
> might not want to do in his main environment).
Problem 1 is that I don't actually know what --ignore-installed does.
My first guess is that it would cause pip to skip uninstalling
packages before upgrading them, resulting in an inconsistent/corrupt
environment. (No, this doesn't sound like particularly useful behavior
to me either, but most operations/switches in pip have semantics that
are somewhat skewed from what I would consider intuitive, so who
knows. It's right next to --no-deps in the --help output, and
--no-deps is literally a "please give me an inconsistent/corrupt
environment" switch, so it's totally plausible that --ignore-installed
is intended for similarly ill-conceived uses.) Or maybe it causes pip
to pretend that the environment is totally empty when picking the set
of (package, version) tuples to install, triggering upgrades of
dependent packages? I would actually guess both of those before
guessing that it means "please actually install the thing I asked you
to install, but otherwise act normally", and as of right now I still
actually have no idea which of these is correct (if any). AFAICT there
aren't any docs -- maybe I'm just failing to search properly.
Problem 2 is that even if --ignore-installed does do the appropriate
thing, and even if there is some way for me to figure this out, then
it will still inevitably happen that 1 in 10 times I will forget to
mention it, not notice that I have forgotten to mention it, and the
user will not realize that nothing has happened, and just report that
"they installed the new version but they still get the same error",
and then I spend hours tearing out my hair trying to figure out why
not (because I "know" that they actually installed the new version).
If you want to optimize your UI to frustrate people and waste their
time, then a really impressively good technique is to include a
special switch that usually does nothing, but every once in a while is
necessary, and if you forget it then the computer and the user's
mental model will get totally out of sync. Otherwise, though... :-/
> Maybe you could argue that you want --ignore-installed to be the
> default (probably only when a file is specified rather than a
> requirement, assuming that distinguishing between a file and a
> requirement is practical). But if we did that, we'd still need a
> --dont-ignore-installed flag to restore the current behaviour. For
> example, because Christoph Gohlke's builds must be manually
> downloaded, I find it's quite common to download a wheel from his site
> and "pip install" it in a number of environments, with the meaning
> "only if it'd be an upgrade to whatever is currently installed".
Sure, I have no objection to a pip install --only-if-upgrade flag.
-n
--
Nathaniel J. Smith -- http://vorpus.org
More information about the Distutils-SIG
mailing list