[Debian-astro-commits] [python-astropy] 05/10: Use external javascript and css instead of convenience copies

Ole Streicher olebole at moszumanska.debian.org
Thu Jan 12 12:16:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch debian
in repository python-astropy.

commit 5f34baa5288720f5e27722a2feb607fcb87bc822
Author: Ole Streicher <olebole at debian.org>
Date:   Fri Jan 6 14:21:17 2017 +0100

    Use external javascript and css instead of convenience copies
---
 debian/clean                              |  2 ++
 debian/control                            |  6 ++++
 debian/patches/external_python_pkgs.patch | 57 +++++++++++++++++++++++++++++++
 debian/rules                              |  2 +-
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/debian/clean b/debian/clean
index 4fe6d4f..6653bfb 100644
--- a/debian/clean
+++ b/debian/clean
@@ -16,4 +16,6 @@ astropy/wcs/src/docstrings.c
 astropy/extern/configobj/*
 astropy/extern/ply/*
 astropy/extern/six/*
+astropy/extern/js/*
+astropy/extern/css/*
 docs/api/*
diff --git a/debian/control b/debian/control
index bafd85f..14c04dd 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,8 @@ Build-Depends: cython,
                libcfitsio-dev | libcfitsio3-dev,
                liberfa-dev (>= 1.1.0),
                libexpat1-dev,
+               libjs-jquery,
+               libjs-jquery-datatables,
                pkg-config,
                python-all-dev (>= 2.6.6-3~),
                python-astropy-helpers (>= 1.1~),
@@ -61,6 +63,8 @@ Suggests: libxml2-utils,
           python-scipy,
           python-tz,
           python-yaml
+Recommends: libjs-jquery,
+            libjs-jquery-datatables
 Description: Core functionality for performing astrophysics with Python
  The astropy package contains core functionality and some common tools
  needed for performing astronomy and astrophysics research with Python.
@@ -81,6 +85,8 @@ Suggests: libxml2-utils,
           python3-scipy,
           python3-tz,
           python3-yaml
+Recommends: libjs-jquery,
+            libjs-jquery-datatables
 Description: Core functionality for performing astrophysics with Python3
  The astropy package contains core functionality and some common tools
  needed for performing astronomy and astrophysics research with Python3.
diff --git a/debian/patches/external_python_pkgs.patch b/debian/patches/external_python_pkgs.patch
index 1d7551f..d694166 100644
--- a/debian/patches/external_python_pkgs.patch
+++ b/debian/patches/external_python_pkgs.patch
@@ -94,3 +94,60 @@ Description: Use external python modules instead of convenience copies
  
  
  def _find_module(name, path=None):
+--- a/astropy/table/jsviewer.py
++++ b/astropy/table/jsviewer.py
+@@ -30,8 +30,8 @@
+ conf = Conf()
+ 
+ 
+-EXTERN_JS_DIR = abspath(join(dirname(extern.__file__), 'js'))
+-EXTERN_CSS_DIR = abspath(join(dirname(extern.__file__), 'css'))
++EXTERN_JS_DIR = '/usr/share/javascript'
++EXTERN_CSS_DIR = EXTERN_JS_DIR
+ 
+ IPYNB_JS_SCRIPT = """
+ <script>
+@@ -108,22 +108,24 @@
+     @property
+     def jquery_urls(self):
+         if self._use_local_files:
+-            return ['file://' + join(EXTERN_JS_DIR, 'jquery-3.1.1.min.js'),
+-                    'file://' + join(EXTERN_JS_DIR, 'jquery.dataTables.min.js')]
++            return ['file://' + join(EXTERN_JS_DIR, 'jquery', 'jquery.min.js'),
++                    'file://' + join(EXTERN_JS_DIR, 'jquery-datatables',
++                                     'jquery.dataTables.min.js')]
+         else:
+             return [conf.jquery_url, conf.datatables_url]
+ 
+     @property
+     def css_urls(self):
+         if self._use_local_files:
+-            return ['file://' + join(EXTERN_CSS_DIR,
++            return ['file://' + join(EXTERN_CSS_DIR, 'jquery-datatables', 'css',
+                                      'jquery.dataTables.css')]
+         else:
+             return conf.css_urls
+ 
+     def _jstable_file(self):
+         if self._use_local_files:
+-            return 'file://' + join(EXTERN_JS_DIR, 'jquery.dataTables.min')
++            return 'file://' + join(EXTERN_JS_DIR, 'jquery-datatables',
++                                    'jquery.dataTables.min')
+         else:
+             return conf.datatables_url[:-3]
+ 
+--- a/astropy/table/tests/test_jsviewer.py
++++ b/astropy/table/tests/test_jsviewer.py
+@@ -127,9 +127,9 @@
+         table_id='test',
+         length='50',
+         display_length='10, 25, 50, 100, 500, 1000',
+-        datatables_css_url='file://' + join(EXTERN_DIR, 'css', 'jquery.dataTables.css'),
+-        datatables_js_url='file://' + join(EXTERN_DIR, 'js', 'jquery.dataTables.min.js'),
+-        jquery_url='file://' + join(EXTERN_DIR, 'js', 'jquery-3.1.1.min.js')
++        datatables_css_url='file:///usr/share/javascript/jquery-datatables/css/jquery.dataTables.css'),
++        datatables_js_url='file:///usr/share/javascript/jquery-datatables/jquery.dataTables.min.js'),
++        jquery_url='file:///usr/share/javascript/jquery/jquery.min.js')
+     )
+     with open(tmpfile) as f:
+         assert f.read().strip() == ref.strip()
diff --git a/debian/rules b/debian/rules
index 0cdbd1a..df33b64 100755
--- a/debian/rules
+++ b/debian/rules
@@ -53,7 +53,7 @@ override_dh_auto_clean:
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 test-python%:
-	python$* setup.py test -vv --args -v
+	python$* setup.py test -vv --args -vv
 
 override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
 endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/python-astropy.git



More information about the Debian-astro-commits mailing list