From 4562113aef864a575b93febb6a7e839a159babaa Mon Sep 17 00:00:00 2001 From: d116626 Date: Tue, 2 Apr 2024 14:35:55 -0300 Subject: [PATCH] chore: add timeout to pypi warning --- python-package/basedosdados/_warnings.py | 5 ++++- python-package/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python-package/basedosdados/_warnings.py b/python-package/basedosdados/_warnings.py index 55e4df953..2d68d9688 100644 --- a/python-package/basedosdados/_warnings.py +++ b/python-package/basedosdados/_warnings.py @@ -1,6 +1,7 @@ """ Checks for warnings and general-purpose messages and displays them to the user. """ + from typing import List, Tuple import requests @@ -12,7 +13,9 @@ def get_latest_version_number(): """Get the latest version number from PyPI.""" try: - response = requests.get("https://pypi.python.org/pypi/basedosdados/json") + response = requests.get( + "https://pypi.python.org/pypi/basedosdados/json", timeout=5 + ) return response.json()["info"]["version"] except: # noqa logger.warning( diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index 946ca0998..05da42635 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "basedosdados" -version = "2.0.0-beta.15" +version = "2.0.0-beta.16" description = "Organizar e facilitar o acesso a dados brasileiros através de tabelas públicas no BigQuery." authors = ["Joao Carabetta ", "Ricardo Dahis", "Diego Oliveira"] classifiers = [