blob: 25c49afb975bcd2a6657be71b42d819aafc0813e [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001Disable automatic downloading of components!
2
3Upstream-Status: Inappropriate [disable feature]
4
5Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
6
7--- a/setup.py
8+++ b/setup.py
Andrew Geissler87f5cff2022-09-30 13:13:31 -05009@@ -316,8 +316,6 @@ setup( # Finally, pass this all along t
10 setup_requires=[
Andrew Geissler595f6302022-01-24 19:11:47 +000011 "certifi>=2020.06.20",
12 "numpy>=1.17",
Andrew Geissler87f5cff2022-09-30 13:13:31 -050013- "setuptools_scm>=4,<7",
Andrew Geissler595f6302022-01-24 19:11:47 +000014- "setuptools_scm_git_archive",
15 ],
16 install_requires=[
17 "cycler>=0.10",
18--- a/setupext.py
19+++ b/setupext.py
20@@ -64,40 +64,7 @@ def get_from_cache_or_download(url, sha)
21 BytesIO
22 The file loaded into memory.
23 """
24- cache_dir = _get_xdg_cache_dir()
25-
26- if cache_dir is not None: # Try to read from cache.
27- try:
28- data = (cache_dir / sha).read_bytes()
29- except IOError:
30- pass
31- else:
32- if _get_hash(data) == sha:
33- return BytesIO(data)
34-
35- # jQueryUI's website blocks direct downloads from urllib.request's
36- # default User-Agent, but not (for example) wget; so I don't feel too
37- # bad passing in an empty User-Agent.
38- with urllib.request.urlopen(
39- urllib.request.Request(url, headers={"User-Agent": ""}),
40- context=_get_ssl_context()) as req:
41- data = req.read()
42-
43- file_sha = _get_hash(data)
44- if file_sha != sha:
45- raise Exception(
46- f"The downloaded file does not match the expected sha. {url} was "
47- f"expected to have {sha} but it had {file_sha}")
48-
49- if cache_dir is not None: # Try to cache the downloaded file.
50- try:
51- cache_dir.mkdir(parents=True, exist_ok=True)
52- with open(cache_dir / sha, "xb") as fout:
53- fout.write(data)
54- except IOError:
55- pass
56-
57- return BytesIO(data)
58+ raise IOError(f"Automatic downloading is disabled.")
59
60
61 def get_and_extract_tarball(urls, sha, dirname):