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