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