|
|
e6f3591 |
From 0ffab3ff58bee5346b9443a8b769d9786aba3b26 Mon Sep 17 00:00:00 2001
|
|
|
b5e6655 |
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|
|
b5e6655 |
Date: Sat, 2 Mar 2019 18:18:29 -0500
|
|
|
b5e6655 |
Subject: [PATCH] Use packaged jquery and jquery-ui.
|
|
|
b5e6655 |
|
|
|
b5e6655 |
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|
|
b5e6655 |
---
|
|
|
e6f3591 |
.../backends/web_backend/all_figures.html | 6 +--
|
|
|
e6f3591 |
.../backends/web_backend/single_figure.html | 6 +--
|
|
|
e6f3591 |
setup.py | 53 -------------------
|
|
|
e6f3591 |
3 files changed, 6 insertions(+), 59 deletions(-)
|
|
|
b5e6655 |
|
|
|
b5e6655 |
diff --git a/lib/matplotlib/backends/web_backend/all_figures.html b/lib/matplotlib/backends/web_backend/all_figures.html
|
|
|
b5e6655 |
index 41f48dc6d..69097eb4f 100644
|
|
|
b5e6655 |
--- a/lib/matplotlib/backends/web_backend/all_figures.html
|
|
|
b5e6655 |
+++ b/lib/matplotlib/backends/web_backend/all_figures.html
|
|
|
b5e6655 |
@@ -3,9 +3,9 @@
|
|
|
b5e6655 |
<link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css">
|
|
|
b5e6655 |
<link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" />
|
|
|
b5e6655 |
<link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" />
|
|
|
b5e6655 |
- <link rel="stylesheet" href="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.css" >
|
|
|
b5e6655 |
- <script src="{{ prefix }}/_static/jquery-ui-1.12.1/external/jquery/jquery.js"></script>
|
|
|
b5e6655 |
- <script src="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.js"></script>
|
|
|
b5e6655 |
+ <link rel="stylesheet" href="/usr/share/javascript/jquery_ui/jquery-ui.min.css" >
|
|
|
b5e6655 |
+ <script src="/usr/share/javascript/jquery/latest/jquery.min.js"></script>
|
|
|
b5e6655 |
+ <script src="/usr/share/javascript/jquery_ui/jquery-ui.min.js"></script>
|
|
|
b5e6655 |
<script src="{{ prefix }}/_static/js/mpl_tornado.js"></script>
|
|
|
b5e6655 |
<script src="{{ prefix }}/js/mpl.js"></script>
|
|
|
b5e6655 |
|
|
|
b5e6655 |
diff --git a/lib/matplotlib/backends/web_backend/single_figure.html b/lib/matplotlib/backends/web_backend/single_figure.html
|
|
|
b5e6655 |
index 4d5a366fb..c11c86618 100644
|
|
|
b5e6655 |
--- a/lib/matplotlib/backends/web_backend/single_figure.html
|
|
|
b5e6655 |
+++ b/lib/matplotlib/backends/web_backend/single_figure.html
|
|
|
b5e6655 |
@@ -3,9 +3,9 @@
|
|
|
b5e6655 |
<link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css">
|
|
|
b5e6655 |
<link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" />
|
|
|
b5e6655 |
<link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" />
|
|
|
b5e6655 |
- <link rel="stylesheet" href="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.css" >
|
|
|
b5e6655 |
- <script src="{{ prefix }}/_static/jquery-ui-1.12.1/external/jquery/jquery.js"></script>
|
|
|
b5e6655 |
- <script src="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.js"></script>
|
|
|
b5e6655 |
+ <link rel="stylesheet" href="/usr/share/javascript/jquery_ui/jquery-ui.min.css" >
|
|
|
b5e6655 |
+ <script src="/usr/share/javascript/jquery/latest/jquery.min.js"></script>
|
|
|
b5e6655 |
+ <script src="/usr/share/javascript/jquery_ui/jquery-ui.min.js"></script>
|
|
|
b5e6655 |
<script src="{{ prefix }}/_static/js/mpl_tornado.js"></script>
|
|
|
b5e6655 |
<script src="{{ prefix }}/js/mpl.js"></script>
|
|
|
b5e6655 |
<script>
|
|
|
b5e6655 |
diff --git a/setup.py b/setup.py
|
|
|
e6f3591 |
index 760e84af1..2b184749f 100644
|
|
|
b5e6655 |
--- a/setup.py
|
|
|
b5e6655 |
+++ b/setup.py
|
|
|
e6f3591 |
@@ -26,8 +26,6 @@ from zipfile import ZipFile
|
|
|
b5e6655 |
|
|
|
e6f3591 |
from setuptools import setup, find_packages, Extension
|
|
|
b5e6655 |
from setuptools.command.build_ext import build_ext as BuildExtCommand
|
|
|
b5e6655 |
-from setuptools.command.develop import develop as DevelopCommand
|
|
|
b5e6655 |
-from setuptools.command.install_lib import install_lib as InstallLibCommand
|
|
|
b5e6655 |
from setuptools.command.test import test as TestCommand
|
|
|
b5e6655 |
|
|
|
b5e6655 |
# The setuptools version of sdist adds a setup.cfg file to the tree.
|
|
|
e6f3591 |
@@ -115,57 +113,6 @@ cmdclass['test'] = NoopTestCommand
|
|
|
b5e6655 |
cmdclass['build_ext'] = BuildExtraLibraries
|
|
|
b5e6655 |
|
|
|
b5e6655 |
|
|
|
b5e6655 |
-def _download_jquery_to(dest):
|
|
|
b5e6655 |
- # Note: When bumping the jquery-ui version, also update the versions in
|
|
|
b5e6655 |
- # single_figure.html and all_figures.html.
|
|
|
b5e6655 |
- url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
|
|
|
e6f3591 |
- sha = "f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d"
|
|
|
e6f3591 |
- name = Path(url).stem
|
|
|
e6f3591 |
- if (dest / name).exists():
|
|
|
e6f3591 |
- return
|
|
|
e6f3591 |
- # If we are installing from an sdist, use the already downloaded jquery-ui.
|
|
|
e6f3591 |
- sdist_src = Path("lib/matplotlib/backends/web_backend", name)
|
|
|
e6f3591 |
- if sdist_src.exists():
|
|
|
e6f3591 |
- shutil.copytree(sdist_src, dest / name)
|
|
|
e6f3591 |
- return
|
|
|
e6f3591 |
- if not (dest / name).exists():
|
|
|
e6f3591 |
- dest.mkdir(parents=True, exist_ok=True)
|
|
|
b5e6655 |
- try:
|
|
|
b5e6655 |
- buff = download_or_cache(url, sha)
|
|
|
b5e6655 |
- except Exception:
|
|
|
e6f3591 |
- raise IOError(f"Failed to download jquery-ui. Please download "
|
|
|
e6f3591 |
- f"{url} and extract it to {dest}.")
|
|
|
b5e6655 |
- with ZipFile(buff) as zf:
|
|
|
b5e6655 |
- zf.extractall(dest)
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-# Relying on versioneer's implementation detail.
|
|
|
b5e6655 |
-class sdist_with_jquery(cmdclass['sdist']):
|
|
|
b5e6655 |
- def make_release_tree(self, base_dir, files):
|
|
|
e6f3591 |
- super().make_release_tree(base_dir, files)
|
|
|
b5e6655 |
- _download_jquery_to(
|
|
|
e6f3591 |
- Path(base_dir, "lib/matplotlib/backends/web_backend/"))
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-# Affects install and bdist_wheel.
|
|
|
b5e6655 |
-class install_lib_with_jquery(InstallLibCommand):
|
|
|
b5e6655 |
- def run(self):
|
|
|
e6f3591 |
- super().run()
|
|
|
b5e6655 |
- _download_jquery_to(
|
|
|
e6f3591 |
- Path(self.install_dir, "matplotlib/backends/web_backend/"))
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-class develop_with_jquery(DevelopCommand):
|
|
|
b5e6655 |
- def run(self):
|
|
|
e6f3591 |
- super().run()
|
|
|
e6f3591 |
- _download_jquery_to(Path("lib/matplotlib/backends/web_backend/"))
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-cmdclass['sdist'] = sdist_with_jquery
|
|
|
b5e6655 |
-cmdclass['install_lib'] = install_lib_with_jquery
|
|
|
b5e6655 |
-cmdclass['develop'] = develop_with_jquery
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
-
|
|
|
b5e6655 |
# One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,
|
|
|
b5e6655 |
# however, this is needed on Windows to avoid creating infinite subprocesses
|
|
|
b5e6655 |
# when using multiprocessing.
|
|
|
b5e6655 |
--
|
|
|
9046bbb |
2.21.0
|
|
|
b5e6655 |
|