Imported Upstream version 49.3.1 upstream/49.3.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:07:49 +0000 (07:07 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:07:49 +0000 (07:07 +0900)
.bumpversion.cfg
CHANGES.rst
_distutils_hack/__init__.py
setup.cfg

index 99e5def842edb5b79bb63c902dc28c96e755292a..bb1e621f1608662bec019e6c9375dda84c9502b5 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 49.3.0
+current_version = 49.3.1
 commit = True
 tag = True
 
index da0eada3f2b60e8b313895ba08129be0c76c5b4b..df0230e75f2964b4712125c5413582f162b3c7cd 100644 (file)
@@ -1,3 +1,9 @@
+vv49.3.1
+--------
+
+* #2316: Removed warning when ``distutils`` is imported before ``setuptools`` when ``distutils`` replacement is not enabled.
+
+
 v49.3.0
 -------
 
index 71fa7ce1b9af979d9972e85469f361a24c33c49c..1e7b294bc23656b57588a219898073d68e743cd6 100644 (file)
@@ -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()
 
 
index fd3b11e6c6f02466924d459d49d7610f19d8f5a1..52440198d204896174bf296dd7e7d5ac2711732e 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
 
 [metadata]
 name = setuptools
-version = 49.3.0
+version = 49.3.1
 description = Easily download, build, install, upgrade, and uninstall Python packages
 author = Python Packaging Authority
 author_email = distutils-sig@python.org