On 12 December 2016 at 19:59, Tomas Orsava <tors...@redhat.com> wrote:
> On 12/12/2016 05:39 AM, Nick Coghlan wrote:
>> On 11 December 2016 at 01:33, Donald Stufft <don...@stufft.io> wrote:
>> The benefit of that approach is that it would not only solve the
>> conflict between dnf and pip at the Fedora level, but also move the
>> packaging user experience forward for the Python ecosystem as a whole
>> (by making the `--global` switch available in anticipation of a future
>> upstream switch to `--user` as the default).
>
> It would be a partial solution I think. People who first try sudo-less `pip3
> install` would be covered, but there are great many people that already go
> with `sudo pip3 install` right away, as well as many install guides on the
> Internet that advise to do so. In that case pip would probably install it
> under /root, which wouldn't be accessible from user-run python.

I think it would make sense to emit a warning when `--user` is used as
UID 0, so you'd end up with the following situation:

* `pip3 install --user <install-args>` remains unchanged
* `pip3 install <install-args>` usually just works (since we have
`~/.local/bin` on the default PATH)
* `pip3 install --global <install-args>` handles RPM and container builds
* `sudo pip3 install <install-args>` stops even appearing to work for
user-run scripts (since it installs into /root), no longer conflicts
with DNF, and emits a warning
* `sudo pip3 install --global <install-args>` is available if you
really know what you're doing and are prepared to deal with the
consequences

If the main goal is to protect naive users from inadvertently breaking
their system Python, making `sudo pip3 install <install-args>` do
something sensible doesn't seem valuable enough to me to maintain an
upstream/downstream behavioural discrepancy over the long term.

However, there's a *different* question, which is whether or not we
want `sudo pip3 install --global <install-args>` to be a nominally
supported thing to do, rather than a matter of "You're a DIY system
integrator now, welcome to the club!". If we genuinely want to do
that, then yes, we'd need something more like the Debian
--install-layout patch. However, one of the problems with that is that
it currently targets setuptools/distutils specifically, which may be a
problem as the upstream changes to enable more flexibility in the
build pipeline come into effect.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org

Reply via email to