diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-05-28 21:11:42 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-05-28 21:11:42 -0400 |
| commit | 620b20a73c488350169d650cf1f0103bf8814515 (patch) | |
| tree | f62750d21d1f63c48a1c9653fe03a17cbaf74332 | |
| parent | 6bf44e11960fa31aaa5b910879fdd4435b524244 (diff) | |
| parent | df51e62984850e58e8f29e8223b714091e0b8a5b (diff) | |
| download | python-setuptools-git-620b20a73c488350169d650cf1f0103bf8814515.tar.gz | |
Merge tag 'v44.1.1'
| -rw-r--r-- | CHANGES.rst | 6 | ||||
| -rw-r--r-- | setuptools/__init__.py | 25 |
2 files changed, 27 insertions, 4 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index dbade950..048fef6b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +v44.1.1 +------- + +* #2158: Avoid loading working set during ``Distribution.finalize_options`` prior to invoking ``_install_setup_requires``, broken since v42.0.0. + + v47.1.0 ------- diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 811f3fd2..833e20ea 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -128,10 +128,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: |
