Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Jan 31, 2025
1 parent 617b82d commit daaa721
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/download_wgpu_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import platform
from zipfile import ZipFile

# Import requests unless doing a noarch build
if os.getenv("WGPU_PY_BUILD_NOARCH", "").lower() not in ("1", "true"):
import requests


DEFAULT_UPSTREAM = "gfx-rs/wgpu-native"

Expand Down Expand Up @@ -47,8 +51,6 @@ def write_current_version(version, commit_sha):


def download_file(url, filename):
import requests # lazy-load so build systems (like Conda) don't necessarily need it

resp = requests.get(url, stream=True)
with open(filename, mode="wb") as fh:
for chunk in resp.iter_content(chunk_size=1024 * 128):
Expand Down

0 comments on commit daaa721

Please sign in to comment.