In pip 21.2, the Distribution here is a wrapper around the regular Distribution.
It has a limited set of API defined by the BaseDistribution protocol.
dist_location() uses the project_name attribute under the hood --
and that is not part of the API.
If we ever upstream this, we should make this check a property of BaseDistribution.
But, for now, we hotfix it by accessing the private wrapped Distribution object directly.
Yes, this is ugly.
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1793456
The main() wrapper moved the import path again, this time with compatibility shim:
- we still need pip-allow-different-versions.patch to support older pips installed by users
- we dropped callable-main.patch - the shim is provided by pip for all previous paths
- no need to patch older pips to support user installed pip 20+
- no need to patch Pythons (or virtualenv) to support pip 20+ wheel in ensurepip