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


Python pkg_resources.invalid_marker方法代码示例

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


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

示例1: check_extras

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import invalid_marker [as 别名]
def check_extras(dist, attr, value):
    """Verify that extras_require mapping is valid"""
    try:
        for k,v in value.items():
            if ':' in k:
                k,m = k.split(':',1)
                if pkg_resources.invalid_marker(m):
                    raise DistutilsSetupError("Invalid environment marker: "+m)
            list(pkg_resources.parse_requirements(v))
    except (TypeError,ValueError,AttributeError):
        raise DistutilsSetupError(
            "'extras_require' must be a dictionary whose values are "
            "strings or lists of strings containing valid project/version "
            "requirement specifiers."
        ) 
开发者ID:jpush,项目名称:jbox,代码行数:17,代码来源:dist.py

示例2: check_extras

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import invalid_marker [as 别名]
def check_extras(dist, attr, value):
    """Verify that extras_require mapping is valid"""
    try:
        for k, v in value.items():
            if ':' in k:
                k, m = k.split(':', 1)
                if pkg_resources.invalid_marker(m):
                    raise DistutilsSetupError("Invalid environment marker: " + m)
            list(pkg_resources.parse_requirements(v))
    except (TypeError, ValueError, AttributeError):
        raise DistutilsSetupError(
            "'extras_require' must be a dictionary whose values are "
            "strings or lists of strings containing valid project/version "
            "requirement specifiers."
        ) 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:17,代码来源:dist.py

示例3: _check_extra

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import invalid_marker [as 别名]
def _check_extra(extra, reqs):
    name, sep, marker = extra.partition(':')
    if marker and pkg_resources.invalid_marker(marker):
        raise DistutilsSetupError("Invalid environment marker: " + marker)
    list(pkg_resources.parse_requirements(reqs)) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:7,代码来源:dist.py

示例4: marker_passes

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import invalid_marker [as 别名]
def marker_passes(marker):
        """
        Given an environment marker, return True if the marker is valid
        and matches this environment.
        """
        return (
            not marker
            or not pkg_resources.invalid_marker(marker)
            and pkg_resources.evaluate_marker(marker)
        ) 
开发者ID:saadnpq,项目名称:matrixcli,代码行数:12,代码来源:ptr.py

示例5: marker_passes

# 需要导入模块: import pkg_resources [as 别名]
# 或者: from pkg_resources import invalid_marker [as 别名]
def marker_passes(marker):
		"""
		Given an environment marker, return True if the marker is valid
		and matches this environment.
		"""
		return (
			not marker
			or not pkg_resources.invalid_marker(marker)
			and pkg_resources.evaluate_marker(marker)
		) 
开发者ID:AI-DI,项目名称:Brancher,代码行数:12,代码来源:ptr.py


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