本文整理汇总了Python中ensurepip._PROJECTS属性的典型用法代码示例。如果您正苦于以下问题:Python ensurepip._PROJECTS属性的具体用法?Python ensurepip._PROJECTS怎么用?Python ensurepip._PROJECTS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ensurepip
的用法示例。
在下文中一共展示了ensurepip._PROJECTS属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import ensurepip [as 别名]
# 或者: from ensurepip import _PROJECTS [as 别名]
def main():
outofdate = False
for project, version in ensurepip._PROJECTS:
data = json.loads(urllib2.urlopen(
"https://pypi.python.org/pypi/{}/json".format(project),
).read().decode("utf8"))
upstream_version = data["info"]["version"]
if version != upstream_version:
outofdate = True
print("The latest version of {} on PyPI is {}, but ensurepip "
"has {}".format(project, upstream_version, version))
if outofdate:
sys.exit(1)
示例2: main
# 需要导入模块: import ensurepip [as 别名]
# 或者: from ensurepip import _PROJECTS [as 别名]
def main():
outofdate = False
for project, version in ensurepip._PROJECTS:
data = json.loads(urllib.request.urlopen(
"https://pypi.python.org/pypi/{}/json".format(project),
cadefault=True,
).read().decode("utf8"))
upstream_version = data["info"]["version"]
if version != upstream_version:
outofdate = True
print("The latest version of {} on PyPI is {}, but ensurepip "
"has {}".format(project, upstream_version, version))
if outofdate:
sys.exit(1)
示例3: main
# 需要导入模块: import ensurepip [as 别名]
# 或者: from ensurepip import _PROJECTS [as 别名]
def main():
outofdate = False
for project, version in ensurepip._PROJECTS:
data = json.loads(urllib.request.urlopen(
"https://pypi.org/pypi/{}/json".format(project),
cadefault=True,
).read().decode("utf8"))
upstream_version = data["info"]["version"]
if version != upstream_version:
outofdate = True
print("The latest version of {} on PyPI is {}, but ensurepip "
"has {}".format(project, upstream_version, version))
if outofdate:
sys.exit(1)