Skip to content

Commit

Permalink
chore: add timeout to pypi warning
Browse files Browse the repository at this point in the history
  • Loading branch information
d116626 committed Apr 2, 2024
1 parent dab0051 commit 4562113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python-package/basedosdados/_warnings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Checks for warnings and general-purpose messages and displays them to the user.
"""

from typing import List, Tuple

import requests
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion python-package/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>", "Ricardo Dahis", "Diego Oliveira"]
classifiers = [
Expand Down

0 comments on commit 4562113

Please sign in to comment.