summaryrefslogtreecommitdiff
path: root/_distutils_hack
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-13 20:34:17 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-13 20:34:17 -0400
commit74e476129958dfdf84b88a732fea1dd5ff7a35e6 (patch)
tree992aece0f1afe919e7fc4498db1ff7e9eb04dda3 /_distutils_hack
parentc85bdd84783be705f1dc1ce8b080fab18ddf2f52 (diff)
parent2df5d97f4ea78fa4fe67f49a9f0ab7e48a00dd27 (diff)
downloadpython-setuptools-git-74e476129958dfdf84b88a732fea1dd5ff7a35e6.tar.gz
Merge branch 'master' into bugfix/2232-adopt-distutils-default
Diffstat (limited to '_distutils_hack')
-rw-r--r--_distutils_hack/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py
index e2adabd8..814ee97e 100644
--- a/_distutils_hack/__init__.py
+++ b/_distutils_hack/__init__.py
@@ -16,9 +16,12 @@ def warn_distutils_present():
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
return
warnings.warn(
- "Distutils was imported before Setuptools. This usage is discouraged "
- "and may exhibit undesirable behaviors or errors. Please use "
- "Setuptools' objects directly or at least import Setuptools first.")
+ "Distutils was imported before Setuptools, but importing Setuptools "
+ "also replaces the `distutils` module in `sys.modules`. This may lead "
+ "to undesirable behaviors or errors. To avoid these issues, avoid "
+ "using distutils directly, ensure that setuptools is installed in the "
+ "traditional way (e.g. not an editable install), and/or make sure that "
+ "setuptools is always imported before distutils.")
def clear_distutils():
@@ -56,8 +59,8 @@ def do_override():
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
for more motivation.
"""
- warn_distutils_present()
if enabled():
+ warn_distutils_present()
ensure_local_distutils()