Python setuptools.namespaces 模块,Installer() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用setuptools.namespaces.Installer()

项目:cloud-custodian    作者:capitalone    | 项目源码 | 文件源码
def _install_namespace_package(self, tmp_sitedir):
        # Install our test namespace package in such a way that both py27 and
        # py36 can find it.
        from setuptools import namespaces
        installer = namespaces.Installer()
        class Distribution: namespace_packages = ['namespace_package']
        installer.distribution = Distribution()
        installer.target = os.path.join(tmp_sitedir, 'namespace_package.pth')
        installer.outputs = []
        installer.dry_run = False
        installer.install_namespaces()
        site.addsitedir(tmp_sitedir, known_paths=site._init_pathinfo())