Skip to content

Commit 8107c0c

Browse files
committed
pythonbuild: add code to dump download statistics
So I can see which release artifacts are being used and which ones make good candidates for retirement.
1 parent 70cb815 commit 8107c0c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Justfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,5 @@ release token commit tag:
8787
just release-upload-distributions {{token}} ${datetime} {{tag}}
8888
just release-set-latest-release {{tag}}
8989

90+
download-stats:
91+
build/venv.*/bin/python3 -c 'import pythonbuild.utils as u; u.release_download_statistics()'

pythonbuild/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,3 +577,16 @@ def validate_python_json(info, extension_modules):
577577
"Missing license annotations for extension %s for library files %s"
578578
% (name, ", ".join(sorted(local_links)))
579579
)
580+
581+
582+
def release_download_statistics():
583+
with urllib.request.urlopen(
584+
"https://api.github.com/repos/indygreg/python-build-standalone/releases"
585+
) as fh:
586+
data = json.load(fh)
587+
588+
for release in data:
589+
tag = release["tag_name"]
590+
591+
for asset in release["assets"]:
592+
print("%d\t%s\t%s" % (asset["download_count"], tag, asset["name"]))

0 commit comments

Comments
 (0)