Skip to content

Commit

Permalink
Merge pull request #2876 from gentlegiantJGC/main
Browse files Browse the repository at this point in the history
Fixed string list concatenation error
  • Loading branch information
jaraco authored Feb 12, 2022
2 parents b653408 + 6b0b410 commit 577af8b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/2876.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In the build backend, allow single config settings to be supplied.
21 changes: 19 additions & 2 deletions setuptools/build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import setuptools
import distutils
from ._reqs import parse_strings
from .extern.more_itertools import always_iterable


__all__ = ['get_requires_for_build_sdist',
'get_requires_for_build_wheel',
Expand Down Expand Up @@ -127,9 +129,24 @@ def suppress_known_deprecation():

class _BuildMetaBackend:

def _fix_config(self, config_settings):
@staticmethod
def _fix_config(config_settings):
"""
Ensure config settings meet certain expectations.
>>> fc = _BuildMetaBackend._fix_config
>>> fc(None)
{'--global-option': []}
>>> fc({})
{'--global-option': []}
>>> fc({'--global-option': 'foo'})
{'--global-option': ['foo']}
>>> fc({'--global-option': ['foo']})
{'--global-option': ['foo']}
"""
config_settings = config_settings or {}
config_settings.setdefault('--global-option', [])
config_settings['--global-option'] = list(always_iterable(
config_settings.get('--global-option')))
return config_settings

def _get_build_requires(self, config_settings, requirements):
Expand Down

0 comments on commit 577af8b

Please sign in to comment.