File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ In the build backend, allow single config settings to be supplied.
Original file line number Diff line number Diff line change 3838import setuptools
3939import distutils
4040from ._reqs import parse_strings
41+ from .extern .more_itertools import always_iterable
42+
4143
4244__all__ = ['get_requires_for_build_sdist' ,
4345 'get_requires_for_build_wheel' ,
@@ -127,9 +129,24 @@ def suppress_known_deprecation():
127129
128130class _BuildMetaBackend :
129131
130- def _fix_config (self , config_settings ):
132+ @staticmethod
133+ def _fix_config (config_settings ):
134+ """
135+ Ensure config settings meet certain expectations.
136+
137+ >>> fc = _BuildMetaBackend._fix_config
138+ >>> fc(None)
139+ {'--global-option': []}
140+ >>> fc({})
141+ {'--global-option': []}
142+ >>> fc({'--global-option': 'foo'})
143+ {'--global-option': ['foo']}
144+ >>> fc({'--global-option': ['foo']})
145+ {'--global-option': ['foo']}
146+ """
131147 config_settings = config_settings or {}
132- config_settings .setdefault ('--global-option' , [])
148+ config_settings ['--global-option' ] = list (always_iterable (
149+ config_settings .get ('--global-option' )))
133150 return config_settings
134151
135152 def _get_build_requires (self , config_settings , requirements ):
You can’t perform that action at this time.
0 commit comments