Skip to content

Commit

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

import requests


DEFAULT_UPSTREAM = "gfx-rs/wgpu-native"

Expand Down Expand Up @@ -49,6 +47,8 @@ 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 78fd2f2

Please sign in to comment.