Limit the workaround to Python 3.9 and earlier and add a note to remove the hack altogether in ~6 mo.
diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index f987a53..2431063 100644 --- a/_distutils_hack/__init__.py +++ b/_distutils_hack/__init__.py
@@ -141,7 +141,13 @@ """ 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 0000000..129e909 --- /dev/null +++ b/changelog.d/3460.change.rst
@@ -0,0 +1 @@ +Limit the scope of the _distutils_hack workaround for pip.