Skip to content

Commit

Permalink
Merge pull request #312 from AstarVienna/fh/httpx
Browse files Browse the repository at this point in the history
Migrate from `requests` ➡️ `httpx`
  • Loading branch information
teutoburg authored Dec 19, 2023
2 parents a783dda + e65e922 commit 00ec419
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 279 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ dependencies = [
"pooch>=1.7.0", # for scipy.datasets

"docutils>=0.15",
"requests>=2.28.2",
"httpx>=0.23.0",
"beautifulsoup4>=4.4",
"lxml>=4.5.0",
"pyyaml>5.1",
"more-itertools>=9.0",
"tqdm>=4.66.1",
"requests-cache>1.0",

"synphot>=1.1.0",
"skycalc_ipy>=0.2.0",
Expand Down
4 changes: 2 additions & 2 deletions scopesim/commands/user_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np
import yaml
import requests
import httpx

from .. import rc
from ..utils import find_file, top_level_catch
Expand Down Expand Up @@ -290,7 +290,7 @@ def check_for_updates(package_name):
front_matter = rc.__currsys__["!SIM.file.server_base_url"]
back_matter = f"api.php?package_name={package_name}"
try:
response = requests.get(url=front_matter+back_matter).json()
response = httpx.get(url=front_matter+back_matter).json()
except:
print(f"Offline. Cannot check for updates for {package_name}")
return response
Expand Down
Loading

0 comments on commit 00ec419

Please sign in to comment.