Skip to content

Commit

Permalink
Try using httpx (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
tohtsky authored May 28, 2022
1 parent b23d246 commit 8ca5881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"setuptools>=42",
"wheel",
"pybind11>=2.8.0",
"requests",
"httpx",
"setuptools_scm[toml]>=6.2",
]

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def __str__(self) -> str:
download_target_dir = basedir / "eigen3.zip"
import zipfile

import requests
import httpx

print("Start downloading Eigen library from {}.".format(self.EIGEN3_DIRNAME))
response = requests.get(self.EIGEN3_URL, stream=True, verify=False)
with download_target_dir.open("wb") as ofs:
for chunk in response.iter_content(chunk_size=1024):
ofs.write(chunk)
with httpx.stream("GET", self.EIGEN3_URL, verify=False) as response:
with download_target_dir.open("wb") as ofs:
for chunk in response.iter_bytes(chunk_size=1024):
ofs.write(chunk)
print("Downloaded Eigen into {}.".format(download_target_dir))

with zipfile.ZipFile(download_target_dir) as ifs:
Expand Down

0 comments on commit 8ca5881

Please sign in to comment.