Skip to content

Commit d873c28

Browse files
committed
Use packaged jquery and jquery-ui.
1 parent bff1e4b commit d873c28

File tree

3 files changed

+6
-55
lines changed

3 files changed

+6
-55
lines changed

lib/matplotlib/backends/web_backend/all_figures.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css">
44
<link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" />
55
<link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" />
6-
<link rel="stylesheet" href="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.css" >
7-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/external/jquery/jquery.js"></script>
8-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.js"></script>
6+
<link rel="stylesheet" href="/usr/share/javascript/jquery_ui/jquery-ui.min.css" >
7+
<script src="/usr/share/javascript/jquery/latest/jquery.min.js"></script>
8+
<script src="/usr/share/javascript/jquery_ui/jquery-ui.min.js"></script>
99
<script src="{{ prefix }}/_static/js/mpl_tornado.js"></script>
1010
<script src="{{ prefix }}/js/mpl.js"></script>
1111

lib/matplotlib/backends/web_backend/single_figure.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css">
44
<link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" />
55
<link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" />
6-
<link rel="stylesheet" href="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.css" >
7-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/external/jquery/jquery.js"></script>
8-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.js"></script>
6+
<link rel="stylesheet" href="/usr/share/javascript/jquery_ui/jquery-ui.min.css" >
7+
<script src="/usr/share/javascript/jquery/latest/jquery.min.js"></script>
8+
<script src="/usr/share/javascript/jquery_ui/jquery-ui.min.js"></script>
99
<script src="{{ prefix }}/_static/js/mpl_tornado.js"></script>
1010
<script src="{{ prefix }}/js/mpl.js"></script>
1111
<script>

setup.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
from setuptools import setup
3737
from setuptools.command.build_ext import build_ext as BuildExtCommand
38-
from setuptools.command.develop import develop as DevelopCommand
39-
from setuptools.command.install_lib import install_lib as InstallLibCommand
4038
from setuptools.command.test import test as TestCommand
4139

4240
# The setuptools version of sdist adds a setup.cfg file to the tree.
@@ -146,53 +144,6 @@ def run(self):
146144
cmdclass['build_ext'] = BuildExtraLibraries
147145

148146

149-
def _download_jquery_to(dest):
150-
# Note: When bumping the jquery-ui version, also update the versions in
151-
# single_figure.html and all_figures.html.
152-
url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
153-
sha = 'f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d'
154-
if not os.path.exists(os.path.join(dest, "jquery-ui-1.12.1")):
155-
_makedirs(dest, exist_ok=True)
156-
try:
157-
buff = download_or_cache(url, sha)
158-
except Exception:
159-
raise IOError("Failed to download jquery-ui. Please download " +
160-
"{url} and extract it to {dest}.".format(
161-
url=url, dest=dest))
162-
with ZipFile(buff) as zf:
163-
zf.extractall(dest)
164-
165-
166-
# Relying on versioneer's implementation detail.
167-
_orgin_sdist = cmdclass['sdist']
168-
169-
170-
class sdist_with_jquery(_orgin_sdist):
171-
def make_release_tree(self, base_dir, files):
172-
_orgin_sdist.make_release_tree(self, base_dir, files)
173-
_download_jquery_to(
174-
os.path.join(base_dir, "lib/matplotlib/backends/web_backend/"))
175-
176-
177-
# Affects install and bdist_wheel.
178-
class install_lib_with_jquery(InstallLibCommand):
179-
def run(self):
180-
InstallLibCommand.run(self)
181-
_download_jquery_to(
182-
os.path.join(self.install_dir, "matplotlib/backends/web_backend/"))
183-
184-
185-
class develop_with_jquery(DevelopCommand):
186-
def run(self):
187-
DevelopCommand.run(self)
188-
_download_jquery_to("lib/matplotlib/backends/web_backend/")
189-
190-
191-
cmdclass['sdist'] = sdist_with_jquery
192-
cmdclass['install_lib'] = install_lib_with_jquery
193-
cmdclass['develop'] = develop_with_jquery
194-
195-
196147
# One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,
197148
# however, this is needed on Windows to avoid creating infinite subprocesses
198149
# when using multiprocessing.

0 commit comments

Comments
 (0)