Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | Disable automatic downloading of components! |
| 2 | |
| 3 | Upstream-Status: Inappropriate [disable feature] |
| 4 | |
| 5 | Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> |
| 6 | |
| 7 | --- a/setup.py |
| 8 | +++ b/setup.py |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 9 | @@ -303,7 +303,6 @@ setup( # Finally, pass this all along t |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 10 | setup_requires=[ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 11 | "certifi>=2020.06.20", |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 12 | "numpy>=1.19", |
| 13 | - "setuptools_scm>=7", |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 14 | ], |
| 15 | install_requires=[ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 16 | "contourpy>=1.0.1", |
| 17 | @@ -315,13 +314,7 @@ setup( # Finally, pass this all along t |
| 18 | "pillow>=6.2.0", |
| 19 | "pyparsing>=2.2.1", |
| 20 | "python-dateutil>=2.7", |
| 21 | - ] + ( |
| 22 | - # Installing from a git checkout that is not producing a wheel. |
| 23 | - ["setuptools_scm>=7"] if ( |
| 24 | - Path(__file__).with_name(".git").exists() and |
| 25 | - os.environ.get("CIBUILDWHEEL", "0") != "1" |
| 26 | - ) else [] |
| 27 | - ), |
| 28 | + ], |
| 29 | use_scm_version={ |
| 30 | "version_scheme": "release-branch-semver", |
| 31 | "local_scheme": "node-and-date", |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 32 | --- a/setupext.py |
| 33 | +++ b/setupext.py |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 34 | @@ -65,40 +65,7 @@ def get_from_cache_or_download(url, sha) |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 35 | BytesIO |
| 36 | The file loaded into memory. |
| 37 | """ |
| 38 | - cache_dir = _get_xdg_cache_dir() |
| 39 | - |
| 40 | - if cache_dir is not None: # Try to read from cache. |
| 41 | - try: |
| 42 | - data = (cache_dir / sha).read_bytes() |
| 43 | - except IOError: |
| 44 | - pass |
| 45 | - else: |
| 46 | - if _get_hash(data) == sha: |
| 47 | - return BytesIO(data) |
| 48 | - |
| 49 | - # jQueryUI's website blocks direct downloads from urllib.request's |
| 50 | - # default User-Agent, but not (for example) wget; so I don't feel too |
| 51 | - # bad passing in an empty User-Agent. |
| 52 | - with urllib.request.urlopen( |
| 53 | - urllib.request.Request(url, headers={"User-Agent": ""}), |
| 54 | - context=_get_ssl_context()) as req: |
| 55 | - data = req.read() |
| 56 | - |
| 57 | - file_sha = _get_hash(data) |
| 58 | - if file_sha != sha: |
| 59 | - raise Exception( |
| 60 | - f"The downloaded file does not match the expected sha. {url} was " |
| 61 | - f"expected to have {sha} but it had {file_sha}") |
| 62 | - |
| 63 | - if cache_dir is not None: # Try to cache the downloaded file. |
| 64 | - try: |
| 65 | - cache_dir.mkdir(parents=True, exist_ok=True) |
| 66 | - with open(cache_dir / sha, "xb") as fout: |
| 67 | - fout.write(data) |
| 68 | - except IOError: |
| 69 | - pass |
| 70 | - |
| 71 | - return BytesIO(data) |
| 72 | + raise IOError(f"Automatic downloading is disabled.") |
| 73 | |
| 74 | |
| 75 | def get_and_extract_tarball(urls, sha, dirname): |