|
21 | 21 | sys.exit(error)
|
22 | 22 |
|
23 | 23 | from pathlib import Path
|
24 |
| -import shutil |
25 |
| -from zipfile import ZipFile |
26 | 24 |
|
27 | 25 | from setuptools import setup, find_packages, Extension
|
28 | 26 | from setuptools.command.build_ext import build_ext as BuildExtCommand
|
29 |
| -from setuptools.command.develop import develop as DevelopCommand |
30 |
| -from setuptools.command.install_lib import install_lib as InstallLibCommand |
31 | 27 | from setuptools.command.test import test as TestCommand
|
32 | 28 |
|
33 | 29 | # The setuptools version of sdist adds a setup.cfg file to the tree.
|
|
43 | 39 | from distutils.dist import Distribution
|
44 | 40 |
|
45 | 41 | import setupext
|
46 |
| -from setupext import print_raw, print_status, download_or_cache |
| 42 | +from setupext import print_raw, print_status |
47 | 43 |
|
48 | 44 | # Get the version from versioneer
|
49 | 45 | import versioneer
|
@@ -94,57 +90,6 @@ def build_extensions(self):
|
94 | 90 | cmdclass['build_ext'] = BuildExtraLibraries
|
95 | 91 |
|
96 | 92 |
|
97 |
| -def _download_jquery_to(dest): |
98 |
| - # Note: When bumping the jquery-ui version, also update the versions in |
99 |
| - # single_figure.html and all_figures.html. |
100 |
| - url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip" |
101 |
| - sha = "f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d" |
102 |
| - name = Path(url).stem |
103 |
| - if (dest / name).exists(): |
104 |
| - return |
105 |
| - # If we are installing from an sdist, use the already downloaded jquery-ui. |
106 |
| - sdist_src = Path("lib/matplotlib/backends/web_backend", name) |
107 |
| - if sdist_src.exists(): |
108 |
| - shutil.copytree(sdist_src, dest / name) |
109 |
| - return |
110 |
| - if not (dest / name).exists(): |
111 |
| - dest.mkdir(parents=True, exist_ok=True) |
112 |
| - try: |
113 |
| - buff = download_or_cache(url, sha) |
114 |
| - except Exception: |
115 |
| - raise IOError(f"Failed to download jquery-ui. Please download " |
116 |
| - f"{url} and extract it to {dest}.") |
117 |
| - with ZipFile(buff) as zf: |
118 |
| - zf.extractall(dest) |
119 |
| - |
120 |
| - |
121 |
| -# Relying on versioneer's implementation detail. |
122 |
| -class sdist_with_jquery(cmdclass['sdist']): |
123 |
| - def make_release_tree(self, base_dir, files): |
124 |
| - super().make_release_tree(base_dir, files) |
125 |
| - _download_jquery_to( |
126 |
| - Path(base_dir, "lib/matplotlib/backends/web_backend/")) |
127 |
| - |
128 |
| - |
129 |
| -# Affects install and bdist_wheel. |
130 |
| -class install_lib_with_jquery(InstallLibCommand): |
131 |
| - def run(self): |
132 |
| - super().run() |
133 |
| - _download_jquery_to( |
134 |
| - Path(self.install_dir, "matplotlib/backends/web_backend/")) |
135 |
| - |
136 |
| - |
137 |
| -class develop_with_jquery(DevelopCommand): |
138 |
| - def run(self): |
139 |
| - super().run() |
140 |
| - _download_jquery_to(Path("lib/matplotlib/backends/web_backend/")) |
141 |
| - |
142 |
| - |
143 |
| -cmdclass['sdist'] = sdist_with_jquery |
144 |
| -cmdclass['install_lib'] = install_lib_with_jquery |
145 |
| -cmdclass['develop'] = develop_with_jquery |
146 |
| - |
147 |
| - |
148 | 93 | # One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,
|
149 | 94 | # however, this is needed on Windows to avoid creating infinite subprocesses
|
150 | 95 | # when using multiprocessing.
|
|
0 commit comments