From 19384deced44c2ed9edeaf22764f6420fdd9acf4 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 25 Sep 2026 09:45:59 -0400 Subject: [PATCH 1/2] Fixes #121 --- cli50/__main__.py | 13 ++++++++----- setup.py | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cli50/__main__.py b/cli50/__main__.py index ee300c5..040e382 100644 --- a/cli50/__main__.py +++ b/cli50/__main__.py @@ -5,12 +5,14 @@ import argparse import gettext +import json import os import re -import requests import shutil import subprocess import tzlocal +import urllib.error +import urllib.request from importlib.resources import files from packaging import version @@ -59,9 +61,11 @@ def main(): # Check PyPI for newer version if __version__ and not args["fast"]: try: - release = max(requests.get("https://pypi.org/pypi/cli50/json").json()["releases"], key=version.parse) - assert release <= __version__ - except requests.RequestException: + with urllib.request.urlopen("https://pypi.org/pypi/cli50/json", timeout=10) as response: + releases = json.load(response)["releases"] + release = max(releases, key=version.parse) + assert version.parse(release) <= version.parse(__version__) + except (KeyError, OSError, ValueError): pass except AssertionError: try: @@ -170,7 +174,6 @@ def main(): if not args["fast"]: # Remote manifest - import json try: RemoteManifest = json.loads(subprocess.check_output([ "docker", "manifest", "inspect", f"{IMAGE}:{args['tag']}", "--verbose" diff --git a/setup.py b/setup.py index c8af0e6..1884b16 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,6 @@ "console_scripts": ["cli50=cli50.__main__:main"] }, url="https://github.com/cs50/cli50", - version="8.0.1", + version="8.1.0", include_package_data=True ) From b74dbdce5234bd2d947aa96cba3e719a2ff50da8 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 25 Sep 2026 09:48:55 -0400 Subject: [PATCH 2/2] updated version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1884b16..0282d83 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,6 @@ "console_scripts": ["cli50=cli50.__main__:main"] }, url="https://github.com/cs50/cli50", - version="8.1.0", + version="8.0.2", include_package_data=True )