Fix: Patch scheme to posix_prefix if posix_local and --prefix is specified
While Fedora uses normal posix_prefix scheme but local is added in get_paths, Debian uses posix_local scheme. Current pip implementation only cares vars, so it needs to care the scheme as well, i.e. if posix_local scheme is returned with --prefix, posix_prefix scheme needs to be used.
I suppose posix_local scheme is for installation without --prefix.
Fedora does not look having the issue after https://github.com/fedora-python/cpython/commit/46619783b357d24537e405769f1d62953f9cff52, where get_paths' vars argument is respected. So it is only Debian matter.
Closes https://github.com/pypa/pip/issues/10978
Hi @cielavenir, thanks for your contribution to pip! Just a heads-up that reviews can take a bit since maintainers volunteer their time. Appreciate your contribution and patience!
Following the link to #10978, where this comment links to a Discourse thread. That thread doesn't appear to have come to any conclusion, so I don't think it's reasonable for us to simply apply this PR.
@cielavenir if you want to work on this, I suggest that you get involved on the Discourse thread, and try to work with the participants there to come up with a consensus on how tools should proceed. We can then come back to pip with a plan on the correct way forward. I appreciate that this may seem like a lot of work, but if individual tools and distributions continue to simply patch over the issue without agreeing on the right approach, we'll just end up making things worse rather than better.
@pfmoore Sorry to be late but I prepared updated comments for the thread and updated this pull request's description accordingly.
I submitted Debian patch fix: https://salsa.debian.org/python-team/packages/python-pip/-/merge_requests/1