Use external python modules instead of convenience copies
authorOle Streicher <olebole@debian.org>
Thu, 12 Jan 2017 10:37:47 +0000 (11:37 +0100)
committerOle Streicher <olebole@debian.org>
Wed, 25 Jan 2017 15:17:26 +0000 (15:17 +0000)
Gbp-Pq: Name external_python_pkgs.patch

astropy/coordinates/angle_utilities.py
astropy/extern/configobj.py
astropy/extern/six.py
astropy/table/jsviewer.py
astropy/table/tests/test_jsviewer.py
astropy/tests/helper.py
astropy/units/format/cds.py
astropy/units/format/generic.py
astropy/units/format/ogip.py

index ddaeaf6c99eaf016d7257288b212622a93f273f3..06eefaf7aa8242fecfba6f8e604e32e443d501be 100644 (file)
@@ -64,7 +64,7 @@ class _AngleParser(object):
 
     @classmethod
     def _make_parser(cls):
-        from ..extern.ply import lex, yacc
+        from ply import lex, yacc
 
         # List of token names.
         tokens = (
index 8d1bd8cd89c0b010fabdc03781069d135ac66b33..e3bb0e0e0db40d80bdde7b8a4a4435c0124a084b 100644 (file)
@@ -7,5 +7,8 @@ currently installed version of python.
 Also, this should actually never actually show up as a docstring, because
 it should get overwritten by the appropriate configobj docstring.
 """
+from __future__ import absolute_import
+import validate
+import configobj
+
 
-from .configobj import configobj, validate, __doc__
index 5398fc0bc5e711710ddb0066af49a740e29be2af..fb3a30cb60147d8e70be140eb0fcf1afde1a44c2 100644 (file)
@@ -13,7 +13,7 @@ _SIX_MIN_VERSION = StrictVersion('1.10.0')
 # Update this to prevent Astropy from using its bundled copy of six
 # (but only if some other version of at least _SIX_MIN_VERSION can
 # be provided)
-_SIX_SEARCH_PATH = ['astropy.extern.bundled.six', 'six']
+_SIX_SEARCH_PATH = ['six']
 
 
 def _find_module(name, path=None):
index ae99eb9ded2ba4482cb43697e12fec0320564316..d856cf80b92b84dc5ce0cd93e9d2bf6a8a3a0d7d 100644 (file)
@@ -30,8 +30,8 @@ class Conf(_config.ConfigNamespace):
 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 @@ class JSViewer(object):
     @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]
 
index af04b7ecb2c6ca422c107647bbb3ad9ec6a8dc14..e02d4be779c5af26c7c74502c5b1a5cd568807d7 100644 (file)
@@ -127,9 +127,9 @@ def test_write_jsviewer_local(tmpdir):
         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()
index 9b0bf3b6fe18412ed082506ec3a1b13299bfc420..b9743c5245b4dbcb5b3c1e7e4bf587e50f7c4e55 100644 (file)
@@ -40,7 +40,7 @@ __all__ = ['raises', 'enable_deprecations_as_exceptions', 'remote_data',
            'pickle_protocol', 'generic_recursive_equality_test']
 
 
-if os.environ.get('ASTROPY_USE_SYSTEM_PYTEST') or '_pytest' in sys.modules:
+if True:
     import pytest
 
 else:
index ecb78e2e1635b7732c0fecb591ec06ab839670fc..d864738edfdf896376e08277d22b598204eaa737 100644 (file)
@@ -78,7 +78,7 @@ class CDS(Base):
 
     @classmethod
     def _make_lexer(cls):
-        from ...extern.ply import lex
+        from ply import lex
 
         tokens = cls._tokens
 
@@ -141,7 +141,7 @@ class CDS(Base):
         <https://bitbucket.org/nxg/unity/>`_.
         """
 
-        from ...extern.ply import yacc
+        from ply import yacc
 
         tokens = cls._tokens
 
index f4aa8c0116244dc3a2fcacd085970862a6890104..d404017f46bcef99aa8e7884dd73d1303ff289af 100644 (file)
@@ -102,7 +102,7 @@ class Generic(Base):
 
     @classmethod
     def _make_lexer(cls):
-        from ...extern.ply import lex
+        from ply import lex
 
         tokens = cls._tokens
 
@@ -181,7 +181,7 @@ class Generic(Base):
         formats, the only difference being the set of available unit
         strings.
         """
-        from ...extern.ply import yacc
+        from ply import yacc
 
         tokens = cls._tokens
 
index 7c66a6b474ccdae27a2a2fc2c1761c44fc6d9dfa..9eed1de62f4fb3aba915e39264e426dc176a5d0d 100644 (file)
@@ -110,7 +110,7 @@ class OGIP(generic.Generic):
 
     @classmethod
     def _make_lexer(cls):
-        from ...extern.ply import lex
+        from ply import lex
 
         tokens = cls._tokens
 
@@ -179,7 +179,7 @@ class OGIP(generic.Generic):
         <https://bitbucket.org/nxg/unity/>`_.
         """
 
-        from ...extern.ply import yacc
+        from ply import yacc
 
         tokens = cls._tokens