ultralytics 8.0.85 docs and events updates (#2189)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-04-23 03:29:38 +02:00 committed by GitHub
parent 4af9ca7382
commit 283e334bd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 131 additions and 79 deletions

View file

@ -128,10 +128,11 @@ def check_latest_pypi_version(package_name='ultralytics'):
Returns:
(str): The latest version of the package.
"""
requests.packages.urllib3.disable_warnings() # Disable the InsecureRequestWarning
response = requests.get(f'https://pypi.org/pypi/{package_name}/json', verify=False)
if response.status_code == 200:
return response.json()['info']['version']
with contextlib.suppress(Exception):
requests.packages.urllib3.disable_warnings() # Disable the InsecureRequestWarning
response = requests.get(f'https://pypi.org/pypi/{package_name}/json', timeout=3)
if response.status_code == 200:
return response.json()['info']['version']
return None