Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
ccb4cb20
Commit
ccb4cb20
authored
Aug 10, 2020
by
mergify[bot]
Committed by
GitHub
Aug 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2316 from pganssle/remove_warning
Fix issue with distutils warning
parents
9d7b246c
1410a8e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
_distutils_hack/__init__.py
_distutils_hack/__init__.py
+7
-4
changelog.d/2316.change.rst
changelog.d/2316.change.rst
+1
-0
No files found.
_distutils_hack/__init__.py
View file @
ccb4cb20
...
...
@@ -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
()
...
...
changelog.d/2316.change.rst
0 → 100644
View file @
ccb4cb20
Removed warning when ``distutils`` is imported before ``setuptools`` when ``distutils`` replacement is not enabled.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment