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