本文整理汇总了Python中setuptools.find_namespace_packages方法的典型用法代码示例。如果您正苦于以下问题:Python setuptools.find_namespace_packages方法的具体用法?Python setuptools.find_namespace_packages怎么用?Python setuptools.find_namespace_packages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools
的用法示例。
在下文中一共展示了setuptools.find_namespace_packages方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _parse_packages
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def _parse_packages(self, value):
"""Parses `packages` option value.
:param value:
:rtype: list
"""
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()
if trimmed_value not in find_directives:
return self._parse_list(value)
findns = trimmed_value == find_directives[1]
if findns and not PY3:
raise DistutilsOptionError(
'find_namespace: directive is unsupported on Python < 3.3')
# Read function arguments from a dedicated section.
find_kwargs = self.parse_section_packages__find(
self.sections.get('packages.find', {}))
if findns:
from setuptools import find_namespace_packages as find_packages
else:
from setuptools import find_packages
return find_packages(**find_kwargs)
示例2: _parse_packages
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def _parse_packages(self, value):
"""Parses `packages` option value.
:param value:
:rtype: list
"""
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()
if not trimmed_value in find_directives:
return self._parse_list(value)
findns = trimmed_value == find_directives[1]
if findns and not PY3:
raise DistutilsOptionError('find_namespace: directive is unsupported on Python < 3.3')
# Read function arguments from a dedicated section.
find_kwargs = self.parse_section_packages__find(
self.sections.get('packages.find', {}))
if findns:
from setuptools import find_namespace_packages as find_packages
else:
from setuptools import find_packages
return find_packages(**find_kwargs)
示例3: test_pep420_ns_package
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def test_pep420_ns_package(self):
packages = find_namespace_packages(
self.dist_dir, include=['pkg*'], exclude=['pkg.subpkg.assets'])
self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])
示例4: test_pep420_ns_package_no_includes
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def test_pep420_ns_package_no_includes(self):
packages = find_namespace_packages(
self.dist_dir, exclude=['pkg.subpkg.assets'])
self._assert_packages(
packages, ['docs', 'pkg', 'pkg.nspkg', 'pkg.subpkg'])
示例5: test_pep420_ns_package_no_includes_or_excludes
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def test_pep420_ns_package_no_includes_or_excludes(self):
packages = find_namespace_packages(self.dist_dir)
expected = [
'docs', 'pkg', 'pkg.nspkg', 'pkg.subpkg', 'pkg.subpkg.assets']
self._assert_packages(packages, expected)
示例6: test_regular_package_with_nested_pep420_ns_packages
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def test_regular_package_with_nested_pep420_ns_packages(self):
self._touch('__init__.py', self.pkg_dir)
packages = find_namespace_packages(
self.dist_dir, exclude=['docs', 'pkg.subpkg.assets'])
self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])
示例7: test_pep420_ns_package_no_non_package_dirs
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import find_namespace_packages [as 别名]
def test_pep420_ns_package_no_non_package_dirs(self):
shutil.rmtree(self.docs_dir)
shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets'))
packages = find_namespace_packages(self.dist_dir)
self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])