[Python-ideas] High time for a builtin function to manage packages (simply)?
Nathaniel Smith
njs at pobox.com
Mon Sep 7 07:07:35 CEST 2015
On Sep 6, 2015 9:09 PM, "Chris Angelico" <rosuav at gmail.com> wrote:
>
> On Mon, Sep 7, 2015 at 2:05 PM, Donald Stufft <donald at stufft.io> wrote:
> > On September 6, 2015 at 11:26:04 PM, Chris Angelico (rosuav at gmail.com)
wrote:
> >> > How often does pip actually need to upgrade an already-installed
> >> package in order to install something you've just requested?
> >> Maybe the
> >> rule could be simpler: if there are any upgrades at all, regardless
> >> of
> >> whether you've imported from those packages, recommend a restart.
> >> The
> >> use-case I'd be most expecting is this:
> >
> > Due to the nature of ``pip install --upgrade``, it's fairly common. At
this
> > time ``pip install --upgrade`` is "greedy" and will try to upgrade the
named
> > package and all of it's dependencies, even if their is already a
version of the
> > dependency installed that satisfies the version constraints.
>
> Okay. What if "--upgrade" isn't the default when it's being called
> from within an interactive session? Would that work?
FWIW the recursive behaviour of --upgrade is perhaps the single most hated
feature of pip (almost all scientific packages find it so annoying that
they refuse to provide dependency metadata at all), and AFAIK everyone has
agreed to deprecate it in general and replace it with a non-recursive
upgrade command, just no-one has gotten around to it:
https://github.com/pypa/pip/issues/59
So I wouldn't worry about defining special interactive semantics in
particular, someone just has to make the patch to change it in general :-)
The trickier bit is that I'm not sure there's actually any way right now to
know what python packages were affected by a given install or upgrade
command, because it can be the case that after 'pip install X' you then do
'import Y' -- the wheel and module names don't have to match, and in
practice it's not uncommon for there to be discrepancies. (For example,
after 'pip install matplotlib' you can do both 'import matplotlib' and
'import pylab'.)
-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150906/d58ed403/attachment.html>
More information about the Python-ideas
mailing list