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


Python pkg_resources.UnknownExtra方法代码示例

本文整理汇总了Python中pkg_resources.UnknownExtra方法的典型用法代码示例。如果您正苦于以下问题:Python pkg_resources.UnknownExtra方法的具体用法?Python pkg_resources.UnknownExtra怎么用?Python pkg_resources.UnknownExtra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pkg_resources的用法示例。


在下文中一共展示了pkg_resources.UnknownExtra方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testDistroDependsOptions

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def testDistroDependsOptions(self):
        d = self.distRequires("""
            Twisted>=1.5
            [docgen]
            ZConfig>=2.0
            docutils>=0.3
            [fastcgi]
            fcgiapp>=0.1""")
        self.checkRequires(d,"Twisted>=1.5")
        self.checkRequires(
            d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3".split(), ["docgen"]
        )
        self.checkRequires(
            d,"Twisted>=1.5 fcgiapp>=0.1".split(), ["fastcgi"]
        )
        self.checkRequires(
            d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1".split(),
            ["docgen","fastcgi"]
        )
        self.checkRequires(
            d,"Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3".split(),
            ["fastcgi", "docgen"]
        )
        self.assertRaises(pkg_resources.UnknownExtra, d.requires, ["foo"]) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:26,代码来源:test_resources.py

示例2: testDistroDependsOptions

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def testDistroDependsOptions(self):
        d = self.distRequires("""
            Twisted>=1.5
            [docgen]
            ZConfig>=2.0
            docutils>=0.3
            [fastcgi]
            fcgiapp>=0.1""")
        self.checkRequires(d, "Twisted>=1.5")
        self.checkRequires(
            d, "Twisted>=1.5 ZConfig>=2.0 docutils>=0.3".split(), ["docgen"]
        )
        self.checkRequires(
            d, "Twisted>=1.5 fcgiapp>=0.1".split(), ["fastcgi"]
        )
        self.checkRequires(
            d, "Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1".split(),
            ["docgen", "fastcgi"]
        )
        self.checkRequires(
            d, "Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3".split(),
            ["fastcgi", "docgen"]
        )
        with pytest.raises(pkg_resources.UnknownExtra):
            d.requires(["foo"]) 
开发者ID:pypa,项目名称:pkg_resources,代码行数:27,代码来源:test_resources.py

示例3: testDistroDependsOptions

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def testDistroDependsOptions(self):
        d = self.distRequires("""
            Twisted>=1.5
            [docgen]
            ZConfig>=2.0
            docutils>=0.3
            [fastcgi]
            fcgiapp>=0.1""")
        self.checkRequires(d,"Twisted>=1.5")
        self.checkRequires(
            d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3".split(), ["docgen"]
        )
        self.checkRequires(
            d,"Twisted>=1.5 fcgiapp>=0.1".split(), ["fastcgi"]
        )
        self.checkRequires(
            d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1".split(),
            ["docgen","fastcgi"]
        )
        self.checkRequires(
            d,"Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3".split(),
            ["fastcgi", "docgen"]
        )
        with pytest.raises(pkg_resources.UnknownExtra):
            d.requires(["foo"]) 
开发者ID:francelabs,项目名称:datafari,代码行数:27,代码来源:test_resources.py

示例4: _resolve_requirements

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def _resolve_requirements(provider, distribution):
    try:
        requirements = distribution.requires([provider])
    except pkg_resources.UnknownExtra:
        # No extra for this provider
        return True
    else:
        # Extra is defined
        try:
            for requirement in requirements:
                if hasattr(requirement, 'name'):
                    pkg_resources.get_distribution(requirement.name)
                else:
                    pkg_resources.get_distribution(requirement)
        except (pkg_resources.DistributionNotFound, pkg_resources.VersionConflict):
            # At least one extra requirement is not fulfilled
            return False

    return True 
开发者ID:AnalogJ,项目名称:lexicon,代码行数:21,代码来源:discovery.py

示例5: _load_entry_point

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def _load_entry_point(ep_name, name=None):
    """Try to load the entry point ep_name that matches name."""
    for ep in pkg_resources.iter_entry_points(ep_name, name=name):
        try:
            return ep.load()
        except (ImportError, pkg_resources.UnknownExtra, AttributeError):
            continue 
开发者ID:nttcom,项目名称:eclcli,代码行数:9,代码来源:utils.py

示例6: discover_auth_systems

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def discover_auth_systems():
    """Discover the available auth-systems.

    This won't take into account the old style auth-systems.
    """
    ep_name = 'openstack.client.auth_plugin'
    for ep in pkg_resources.iter_entry_points(ep_name):
        try:
            auth_plugin = ep.load()
        except (ImportError, pkg_resources.UnknownExtra, AttributeError) as e:
            logger.debug("ERROR: Cannot load auth plugin %s" % ep.name)
            logger.debug(e, exc_info=1)
        else:
            _discovered_plugins[ep.name] = auth_plugin 
开发者ID:nttcom,项目名称:eclcli,代码行数:16,代码来源:auth_plugin.py

示例7: _load_plugin

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import UnknownExtra [as 别名]
def _load_plugin(self, ep: pkg_resources.EntryPoint):
        try:
            self.logger.debug(" Loading plugin %s" % ep)
            plugin = ep.load(require=True)
            self.logger.debug(" Initializing plugin %s" % ep)
            plugin_context = copy.copy(self.app_context)
            plugin_context.logger = self.logger.getChild(ep.name)
            obj = plugin(plugin_context)
            return Plugin(ep.name, ep, obj)
        except ImportError as ie:
            self.logger.warning("Plugin %r import failed: %s" % (ep, ie))
        except pkg_resources.UnknownExtra as ue:
            self.logger.warning("Plugin %r dependencies resolution failed: %s" % (ep, ue)) 
开发者ID:beerfactory,项目名称:hbmqtt,代码行数:15,代码来源:manager.py


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