From ab10c2234c4cce6061f673341e24f2d3e45acf32 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 24 Jul 2022 13:00:23 -0400 Subject: Limit the workaround to Python 3.9 and earlier and add a note to remove the hack altogether in ~6 mo. --- _distutils_hack/__init__.py | 6 ++++++ changelog.d/3460.change.rst | 1 + 2 files changed, 7 insertions(+) create mode 100644 changelog.d/3460.change.rst diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index f987a536..24310637 100644 --- a/_distutils_hack/__init__.py +++ b/_distutils_hack/__init__.py @@ -141,7 +141,13 @@ class DistutilsMetaFinder: """ Ensure stdlib distutils when running under pip. See pypa/pip#8761 for rationale. + + In pypa/pip#11298, pip added its own workaround, obviating + the need for this one. After 2023-02-01, remove this workaround. """ + # late versions of pip no longer have this issue on Python 3.10+ + if sys.version_info > (3, 10): + return if self.pip_imported_during_build(): return clear_distutils() diff --git a/changelog.d/3460.change.rst b/changelog.d/3460.change.rst new file mode 100644 index 00000000..129e909c --- /dev/null +++ b/changelog.d/3460.change.rst @@ -0,0 +1 @@ +Limit the scope of the _distutils_hack workaround for pip. -- cgit v1.2.1