當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。