当前位置: 首页>>代码示例>>Python>>正文


Python setuptools.find_namespace_packages方法代码示例

本文整理汇总了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) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:29,代码来源:config.py

示例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) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:28,代码来源:config.py

示例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']) 
开发者ID:pypa,项目名称:setuptools,代码行数:6,代码来源:test_find_packages.py

示例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']) 
开发者ID:pypa,项目名称:setuptools,代码行数:7,代码来源:test_find_packages.py

示例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) 
开发者ID:pypa,项目名称:setuptools,代码行数:7,代码来源:test_find_packages.py

示例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']) 
开发者ID:pypa,项目名称:setuptools,代码行数:7,代码来源:test_find_packages.py

示例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']) 
开发者ID:pypa,项目名称:setuptools,代码行数:7,代码来源:test_find_packages.py


注:本文中的setuptools.find_namespace_packages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。