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:
parent
4af9ca7382
commit
283e334bd4
8 changed files with 131 additions and 79 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue