File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed 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 38
38
import setuptools
39
39
import distutils
40
40
from ._reqs import parse_strings
41
+ from .extern .more_itertools import always_iterable
42
+
41
43
42
44
__all__ = ['get_requires_for_build_sdist' ,
43
45
'get_requires_for_build_wheel' ,
@@ -127,9 +129,24 @@ def suppress_known_deprecation():
127
129
128
130
class _BuildMetaBackend :
129
131
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
+ """
131
147
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' )))
133
150
return config_settings
134
151
135
152
def _get_build_requires (self , config_settings , requirements ):
You can’t perform that action at this time.
0 commit comments