|
28 | 28 |
|
29 | 29 | from setuptools import setup, find_packages, Extension
|
30 | 30 | from setuptools.command.build_ext import build_ext as BuildExtCommand
|
31 |
| -from setuptools.command.develop import develop as DevelopCommand |
32 |
| -from setuptools.command.install_lib import install_lib as InstallLibCommand |
33 | 31 | from setuptools.command.test import test as TestCommand
|
34 | 32 |
|
35 | 33 | # The setuptools version of sdist adds a setup.cfg file to the tree.
|
@@ -120,58 +118,6 @@ def build_extensions(self):
|
120 | 118 | cmdclass['build_ext'] = BuildExtraLibraries
|
121 | 119 |
|
122 | 120 |
|
123 |
| -def _download_jquery_to(dest): |
124 |
| - # Note: When bumping the jquery-ui version, also update the versions in |
125 |
| - # single_figure.html and all_figures.html. |
126 |
| - url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip" |
127 |
| - sha = "f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d" |
128 |
| - name = Path(url).stem |
129 |
| - if (dest / name).exists(): |
130 |
| - return |
131 |
| - # If we are installing from an sdist, use the already downloaded jquery-ui. |
132 |
| - sdist_src = Path("lib/matplotlib/backends/web_backend", name) |
133 |
| - if sdist_src.exists(): |
134 |
| - shutil.copytree(sdist_src, dest / name) |
135 |
| - return |
136 |
| - if not (dest / name).exists(): |
137 |
| - dest.mkdir(parents=True, exist_ok=True) |
138 |
| - try: |
139 |
| - buff = download_or_cache(url, sha) |
140 |
| - except Exception: |
141 |
| - raise IOError( |
142 |
| - "Failed to download jquery-ui. Please download " |
143 |
| - "{url} and extract it to {dest}.".format(url=url, dest=dest)) |
144 |
| - with ZipFile(buff) as zf: |
145 |
| - zf.extractall(dest) |
146 |
| - |
147 |
| - |
148 |
| -# Relying on versioneer's implementation detail. |
149 |
| -class sdist_with_jquery(cmdclass['sdist']): |
150 |
| - def make_release_tree(self, base_dir, files): |
151 |
| - super().make_release_tree(base_dir, files) |
152 |
| - _download_jquery_to( |
153 |
| - Path(base_dir, "lib/matplotlib/backends/web_backend/")) |
154 |
| - |
155 |
| - |
156 |
| -# Affects install and bdist_wheel. |
157 |
| -class install_lib_with_jquery(InstallLibCommand): |
158 |
| - def run(self): |
159 |
| - super().run() |
160 |
| - _download_jquery_to( |
161 |
| - Path(self.install_dir, "matplotlib/backends/web_backend/")) |
162 |
| - |
163 |
| - |
164 |
| -class develop_with_jquery(DevelopCommand): |
165 |
| - def run(self): |
166 |
| - super().run() |
167 |
| - _download_jquery_to(Path("lib/matplotlib/backends/web_backend/")) |
168 |
| - |
169 |
| - |
170 |
| -cmdclass['sdist'] = sdist_with_jquery |
171 |
| -cmdclass['install_lib'] = install_lib_with_jquery |
172 |
| -cmdclass['develop'] = develop_with_jquery |
173 |
| - |
174 |
| - |
175 | 121 | # One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,
|
176 | 122 | # however, this is needed on Windows to avoid creating infinite subprocesses
|
177 | 123 | # when using multiprocessing.
|
|
0 commit comments