更改enroll命名,添加了注释,向get_error_msg中添加了一些错误代码
This commit is contained in:
@@ -37,9 +37,8 @@ import warnings
|
||||
|
||||
import setuptools
|
||||
import distutils
|
||||
from ._reqs import parse_strings
|
||||
from .extern.more_itertools import always_iterable
|
||||
|
||||
from pkg_resources import parse_requirements
|
||||
|
||||
__all__ = ['get_requires_for_build_sdist',
|
||||
'get_requires_for_build_wheel',
|
||||
@@ -57,7 +56,7 @@ class SetupRequirementsError(BaseException):
|
||||
|
||||
class Distribution(setuptools.dist.Distribution):
|
||||
def fetch_build_eggs(self, specifiers):
|
||||
specifier_list = list(parse_strings(specifiers))
|
||||
specifier_list = list(map(str, parse_requirements(specifiers)))
|
||||
|
||||
raise SetupRequirementsError(specifier_list)
|
||||
|
||||
@@ -127,26 +126,11 @@ def suppress_known_deprecation():
|
||||
yield
|
||||
|
||||
|
||||
class _BuildMetaBackend:
|
||||
class _BuildMetaBackend(object):
|
||||
|
||||
@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']}
|
||||
"""
|
||||
def _fix_config(self, config_settings):
|
||||
config_settings = config_settings or {}
|
||||
config_settings['--global-option'] = list(always_iterable(
|
||||
config_settings.get('--global-option')))
|
||||
config_settings.setdefault('--global-option', [])
|
||||
return config_settings
|
||||
|
||||
def _get_build_requires(self, config_settings, requirements):
|
||||
@@ -174,10 +158,12 @@ class _BuildMetaBackend:
|
||||
exec(compile(code, __file__, 'exec'), locals())
|
||||
|
||||
def get_requires_for_build_wheel(self, config_settings=None):
|
||||
config_settings = self._fix_config(config_settings)
|
||||
return self._get_build_requires(
|
||||
config_settings, requirements=['wheel'])
|
||||
|
||||
def get_requires_for_build_sdist(self, config_settings=None):
|
||||
config_settings = self._fix_config(config_settings)
|
||||
return self._get_build_requires(config_settings, requirements=[])
|
||||
|
||||
def prepare_metadata_for_build_wheel(self, metadata_directory,
|
||||
|
||||
Reference in New Issue
Block a user