Commit ccb4cb20 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #2316 from pganssle/remove_warning

Fix issue with distutils warning
parents 9d7b246c 1410a8e6
...@@ -16,9 +16,12 @@ def warn_distutils_present(): ...@@ -16,9 +16,12 @@ def warn_distutils_present():
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250 # https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
return return
warnings.warn( warnings.warn(
"Distutils was imported before Setuptools. This usage is discouraged " "Distutils was imported before Setuptools, but importing Setuptools "
"and may exhibit undesirable behaviors or errors. Please use " "also replaces the `distutils` module in `sys.modules`. This may lead "
"Setuptools' objects directly or at least import Setuptools first.") "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(): def clear_distutils():
...@@ -56,8 +59,8 @@ def do_override(): ...@@ -56,8 +59,8 @@ def do_override():
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401 See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
for more motivation. for more motivation.
""" """
warn_distutils_present()
if enabled(): if enabled():
warn_distutils_present()
ensure_local_distutils() ensure_local_distutils()
......
Removed warning when ``distutils`` is imported before ``setuptools`` when ``distutils`` replacement is not enabled.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment