Closed felixonmars closed 3 years ago
Duplicate to #7690. The fix will be included in the next pip release. Sorry for the inconvinience!
@uranusjr No, it's not the same problem. I already applied #7690 but the difference in behavior caused these test failures.
Ah, I see, sorry for messing up. I think whether you want to patch appdirs depends on what you want. Most of pip’s patches are for cross-platform compatibility (the changes are documented in the patch file). IIRC the only patch relevant to Arch are
/etc/xdg
if XDG_CONFIG_DIRS
is empty. Upstream only defaults to that if the envionment variable is missing./etc/pip.conf
(Upstream does not allow this.)I do not understand how you can violate your contract to not modify vendored projects willy-nilly like this. At the very least, if you think that XDG_CONFIG_DIRS=""
should be treated identically to unset (my vague memory of the XDG spec is that it should be?) that would be "fixing a bug in appdirs", so why are you fixing bugs in appdirs.patch rather than pushing bugfixes upstream...
EDIT: yes, double-checked, and this is an upstream bug which makes it even more important that it gets submitted upstream.
As for /etc vs. /etc/xdg, it seems you disagree with the intended behavior of appdirs, so you are modifying the user-facing behavior. If that's so important, you'd think the appdirs developers might be interested in discussing it as well. :/
Both of these changes explicitly violate the directive in https://github.com/pypa/pip/blob/master/src/pip/_vendor/README.rst, and furthermore (or perhaps because they violate the directive?) they are not described in the section "Modifications".
To add some context, the appdirs
vendoring is kinda different from the other ones as it was partially (i.e. 130 lines from the 480 of appdirs) added in pip 6.0 via 52ca0260 without declaring itself as vendored.
The "retrofit" vendoring happened in pip 20 to fix this special case but patches were needed to make it transparent for pip users and unfortunately in the process the vendoring directives were forgotten. Let's say it was semi-vendored to match the semi-supported debundling ;)
Ideally those patches should indeed be either upstreamed or included instead in pip wrapping code https://github.com/pypa/pip/blob/master/src/pip/_internal/utils/appdirs.py.
Concerning XDG_CONFIG_DIRS
, https://github.com/ActiveState/appdirs/pull/131/files seems to be what you are looking for.
Concerning the other patches, pull requests are always welcome :)
The XDG_CONFIG_DIRS change looks to be exactly what's needed, thanks. Would have been nice to see that happen years ago, but hmm, better late than never.
As for the rest... Perhaps someone familiar with why pip needs them, could open an issue to discuss each modification with upstream?
Fixed in #7690.
Ah, no, I misread.
The exact patch that pip makes to the vendored appdirs today, can be found at https://github.com/pypa/pip/blob/main/tools/vendoring/patches/appdirs.patch.
We're going to be moving away from apprdirs, to platformdirs -- which is a better maintained fork of the project now. Consolidating this into https://github.com/pypa/pip/issues/10178, since I don't think this would be relevant once that is done.
Environment
Description Looks like after https://github.com/pypa/pip/pull/7501 merged the vendored copy of appdirs is no longer behaving identically as the upstream one. The tests are failing after debundling appdirs.
I would like to know if debundled appdirs must be patched or are the test failures ignorable?