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
474e9044
Commit
474e9044
authored
May 28, 2020
by
Jason R. Coombs
Committed by
GitHub
May 28, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2159 from pypa/bugfix/2158-defer-finalize-options
Defer finalize options
parents
1988125e
2dc4b62d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
changelog.d/2158.misc.rst
changelog.d/2158.misc.rst
+1
-0
setuptools/__init__.py
setuptools/__init__.py
+21
-4
No files found.
changelog.d/2158.misc.rst
0 → 100644
View file @
474e9044
Avoid loading working set during ``Distribution.finalize_options`` prior to invoking ``_install_setup_requires``, broken since v42.0.0.
setuptools/__init__.py
View file @
474e9044
...
...
@@ -129,10 +129,27 @@ if PY3:
def
_install_setup_requires
(
attrs
):
# Note: do not use `setuptools.Distribution` directly, as
# our PEP 517 backend patch `distutils.core.Distribution`.
dist
=
distutils
.
core
.
Distribution
(
dict
(
(
k
,
v
)
for
k
,
v
in
attrs
.
items
()
if
k
in
(
'dependency_links'
,
'setup_requires'
)
))
class
MinimalDistribution
(
distutils
.
core
.
Distribution
):
"""
A minimal version of a distribution for supporting the
fetch_build_eggs interface.
"""
def
__init__
(
self
,
attrs
):
_incl
=
'dependency_links'
,
'setup_requires'
filtered
=
{
k
:
attrs
[
k
]
for
k
in
set
(
_incl
)
&
set
(
attrs
)
}
distutils
.
core
.
Distribution
.
__init__
(
self
,
filtered
)
def
finalize_options
(
self
):
"""
Disable finalize_options to avoid building the working set.
Ref #2158.
"""
dist
=
MinimalDistribution
(
attrs
)
# Honor setup.cfg's options.
dist
.
parse_config_files
(
ignore_option_errors
=
True
)
if
dist
.
setup_requires
:
...
...
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