mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Close #19406: Initial implementation of ensurepip
Patch by Donald Stufft and Nick Coghlan
This commit is contained in:
parent
020af2a2bc
commit
d0cf0635b3
16 changed files with 488 additions and 2 deletions
32
Tools/scripts/checkpip.py
Normal file
32
Tools/scripts/checkpip.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
#/usr/bin/env python3
|
||||
"""
|
||||
Checks that the version of the projects bundled in ensurepip are the latest
|
||||
versions available.
|
||||
"""
|
||||
import ensurepip
|
||||
import json
|
||||
import urllib.request
|
||||
import sys
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue