|
26 | 26 | from pathlib import Path |
27 | 27 | import shutil |
28 | 28 | import subprocess |
29 | | -from zipfile import ZipFile |
30 | 29 |
|
31 | 30 | from setuptools import setup, find_packages, Extension |
32 | 31 | from setuptools.command.build_ext import build_ext as BuildExtCommand |
33 | | -from setuptools.command.develop import develop as DevelopCommand |
34 | | -from setuptools.command.install_lib import install_lib as InstallLibCommand |
35 | 32 | from setuptools.command.test import test as TestCommand |
36 | 33 |
|
37 | 34 | # The setuptools version of sdist adds a setup.cfg file to the tree. |
|
48 | 45 | from distutils.dist import Distribution |
49 | 46 |
|
50 | 47 | import setupext |
51 | | -from setupext import print_raw, print_status, download_or_cache |
| 48 | +from setupext import print_raw, print_status |
52 | 49 |
|
53 | 50 | # Get the version from versioneer |
54 | 51 | import versioneer |
@@ -182,58 +179,6 @@ def build_extensions(self): |
182 | 179 | cmdclass['build_ext'] = BuildExtraLibraries |
183 | 180 |
|
184 | 181 |
|
185 | | -def _download_jquery_to(dest): |
186 | | - # Note: When bumping the jquery-ui version, also update the versions in |
187 | | - # single_figure.html and all_figures.html. |
188 | | - url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip" |
189 | | - sha = "f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d" |
190 | | - name = Path(url).stem |
191 | | - if (dest / name).exists(): |
192 | | - return |
193 | | - # If we are installing from an sdist, use the already downloaded jquery-ui. |
194 | | - sdist_src = Path("lib/matplotlib/backends/web_backend", name) |
195 | | - if sdist_src.exists(): |
196 | | - shutil.copytree(sdist_src, dest / name) |
197 | | - return |
198 | | - if not (dest / name).exists(): |
199 | | - dest.mkdir(parents=True, exist_ok=True) |
200 | | - try: |
201 | | - buff = download_or_cache(url, sha) |
202 | | - except Exception: |
203 | | - raise IOError( |
204 | | - "Failed to download jquery-ui. Please download " |
205 | | - "{url} and extract it to {dest}.".format(url=url, dest=dest)) |
206 | | - with ZipFile(buff) as zf: |
207 | | - zf.extractall(dest) |
208 | | - |
209 | | - |
210 | | -# Relying on versioneer's implementation detail. |
211 | | -class sdist_with_jquery(cmdclass['sdist']): |
212 | | - def make_release_tree(self, base_dir, files): |
213 | | - super().make_release_tree(base_dir, files) |
214 | | - _download_jquery_to( |
215 | | - Path(base_dir, "lib/matplotlib/backends/web_backend/")) |
216 | | - |
217 | | - |
218 | | -# Affects install and bdist_wheel. |
219 | | -class install_lib_with_jquery(InstallLibCommand): |
220 | | - def run(self): |
221 | | - super().run() |
222 | | - _download_jquery_to( |
223 | | - Path(self.install_dir, "matplotlib/backends/web_backend/")) |
224 | | - |
225 | | - |
226 | | -class develop_with_jquery(DevelopCommand): |
227 | | - def run(self): |
228 | | - super().run() |
229 | | - _download_jquery_to(Path("lib/matplotlib/backends/web_backend/")) |
230 | | - |
231 | | - |
232 | | -cmdclass['sdist'] = sdist_with_jquery |
233 | | -cmdclass['install_lib'] = install_lib_with_jquery |
234 | | -cmdclass['develop'] = develop_with_jquery |
235 | | - |
236 | | - |
237 | 182 | package_data = {} # Will be filled below by the various components. |
238 | 183 |
|
239 | 184 | # If the user just queries for information, don't bother figuring out which |
|
0 commit comments