本文整理汇总了Python中distutils.core.Distribution.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.__init__方法的具体用法?Python Distribution.__init__怎么用?Python Distribution.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.core.Distribution
的用法示例。
在下文中一共展示了Distribution.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs=None):
have_package_data = hasattr(self, "package_data")
if not have_package_data:
self.package_data = {}
_attrs_dict = attrs or {}
if 'features' in _attrs_dict or 'require_features' in _attrs_dict:
Feature.warn_deprecated()
self.require_features = []
self.features = {}
self.dist_files = []
self.src_root = attrs and attrs.pop("src_root", None)
self.patch_missing_pkg_info(attrs)
# Make sure we have any eggs needed to interpret 'attrs'
if attrs is not None:
self.dependency_links = attrs.pop('dependency_links', [])
assert_string_list(self,'dependency_links',self.dependency_links)
if attrs and 'setup_requires' in attrs:
self.fetch_build_eggs(attrs.pop('setup_requires'))
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
if not hasattr(self,ep.name):
setattr(self,ep.name,None)
_Distribution.__init__(self,attrs)
if isinstance(self.metadata.version, numeric_types):
# Some people apparently take "version number" too literally :)
self.metadata.version = str(self.metadata.version)
示例2: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs=None):
_Distribution.__init__(self, attrs)
if not self.ext_modules:
return
for idx in range(len(self.ext_modules) - 1, -1, -1):
ext = self.ext_modules[idx]
if not isinstance(ext, Extension):
continue
setattr(self, ext.attr_name, None)
self.global_options = [
(
ext.option_name,
None,
"include %s (default if %s is available)"
% (ext.feature_description, ext.feature_name),
),
(ext.neg_option_name, None, "exclude %s" % ext.feature_description),
] + self.global_options
self.negative_opt = self.negative_opt.copy()
self.negative_opt[ext.neg_option_name] = ext.option_name
示例3: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs=None):
have_package_data = hasattr(self, "package_data")
if not have_package_data:
self.package_data = {}
_attrs_dict = attrs or {}
if 'features' in _attrs_dict or 'require_features' in _attrs_dict:
Feature.warn_deprecated()
self.require_features = []
self.features = {}
self.dist_files = []
self.src_root = attrs and attrs.pop("src_root", None)
self.patch_missing_pkg_info(attrs)
# Make sure we have any eggs needed to interpret 'attrs'
if attrs is not None:
self.dependency_links = attrs.pop('dependency_links', [])
assert_string_list(self,'dependency_links',self.dependency_links)
if attrs and 'setup_requires' in attrs:
self.fetch_build_eggs(attrs['setup_requires'])
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
if not hasattr(self,ep.name):
setattr(self,ep.name,None)
_Distribution.__init__(self,attrs)
if isinstance(self.metadata.version, numbers.Number):
# Some people apparently take "version number" too literally :)
self.metadata.version = str(self.metadata.version)
示例4: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs):
# this does most of the work...
build_num = committed_rev()
if build_num:
# if there is SVN revision data, assign the new version number
attrs['version'] = '%i' % build_num
try:
# then try to create a user specified version file
filename, format = attrs['version_file']
file(filename,'w').write(format % build_num)
# in case a 'version_file' attribute was not set, do nothing
except KeyError:
pass
# the parent class does not know about 'version_file', so delete it
del attrs['version_file']
Distribution.__init__(self, attrs)
示例5: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs = None):
# A list of (sconscripts, pre_hook, post_hook, src, parent_names)
self.scons_data = []
# A list of installable libraries
self.installed_libraries = []
# A dict of pkg_config files to generate/install
self.installed_pkg_config = {}
Distribution.__init__(self, attrs)
示例6: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, description, standard=False, available=True,
optional=True, require_features=(), remove=(), **extras):
self.warn_deprecated()
self.description = description
self.standard = standard
self.available = available
self.optional = optional
if isinstance(require_features,(str,Require)):
require_features = require_features,
self.require_features = [
r for r in require_features if isinstance(r,str)
]
er = [r for r in require_features if not isinstance(r,str)]
if er: extras['require_features'] = er
if isinstance(remove,str):
remove = remove,
self.remove = remove
self.extras = extras
if not remove and not require_features and not extras:
raise DistutilsSetupError(
"Feature %s: must define 'require_features', 'remove', or at least one"
" of 'packages', 'py_modules', etc."
)
示例7: __init__
# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self,attrs=None):
self.twisted_plugins = None
Distribution.__init__(self, attrs)
self.cmdclass = {'install':twisted_install,
'install_twisted_plugins':install_twisted_plugins,
'build':twisted_build,
'build_twisted_plugins':build_twisted_plugins,
'sdist':twisted_sdist,
}