Test sdist process and make sure pywwt is installed/enabled as far as Jupyter is concerned.

This commit is contained in:
Thomas Robitaille 2018-04-05 14:58:47 +01:00
Родитель 25d6042e19
Коммит 1b722636c3
10 изменённых файлов: 42 добавлений и 18 удалений

19
.check_enabled.py Normal file
Просмотреть файл

@ -0,0 +1,19 @@
import sys
from jupyterlab.commands import get_app_info
from notebook.nbextensions import validate_nbextension
from notebook.serverextensions import validate_serverextension
if validate_nbextension('pywwt/extension') != []:
print("Issue detected with nbextension")
sys.exit(1)
info = get_app_info()
if 'pywwt' not in info['extensions'] or 'pywwt' in info['disabled']:
print("Issue detected with labextension")
sys.exit(1)
if validate_serverextension('pywwt') != []:
print("Issue detected with serverextension")
sys.exit(1)

1
.gitignore поставляемый
Просмотреть файл

@ -60,3 +60,4 @@ distribute-*.tar.gz
.DS_Store
js/node_modules
node_modules

Просмотреть файл

@ -25,8 +25,13 @@ env:
install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- pip install .
script:
- python setup.py sdist
- cd dist; pip install *.tar.gz --verbose; cd ..
- jupyter nbextension list
- jupyter labextension list
- jupyter serverextension list
- python .check_enabled.py
- py.test pywwt
- cd docs ; make html linkcheck

Просмотреть файл

@ -1,11 +0,0 @@
WorldWide Telescope Jupyter widget
Package Install
---------------
**Prerequisites**
- [node](http://nodejs.org/)
```bash
npm install --save pywwt
```

Просмотреть файл

@ -0,0 +1,7 @@
{
"NotebookApp": {
"nbserver_extensions": {
"pywwt": true
}
}
}

Просмотреть файл

Просмотреть файл

@ -21,7 +21,7 @@
},
"scripts": {
"build": "npm run build:nbextension",
"build:labextension": "cd pywwt && rimraf labextension && mkdirp labextension && cd labextension && npm pack ../..",
"build:labextension": "cd pywwt && rimraf labextension && mkdir labextension && cd labextension && npm pack ../..",
"build:nbextension": "webpack",
"build:all": "npm run build:labextension && npm run build:nbextension",
"clean": "npm run clean:nbextension",

Просмотреть файл

@ -16,12 +16,12 @@ from .logger import logger
__all__ = ['WWTQtClient']
WWT_JSON_FILE = os.path.join(os.path.dirname(__file__), 'static', 'wwt_json_api.js')
WWT_JSON_FILE = os.path.join(os.path.dirname(__file__), 'nbextension', 'static', 'wwt_json_api.js')
with open(WWT_JSON_FILE) as f:
WWT_JSON = f.read()
WWT_HTML_FILE = os.path.join(os.path.dirname(__file__), 'static', 'wwt.html')
WWT_HTML_FILE = os.path.join(os.path.dirname(__file__), 'nbextension', 'static', 'wwt.html')
with open(WWT_HTML_FILE) as f:
WWT_HTML = f.read()

Просмотреть файл

@ -5,7 +5,7 @@ from traitlets import TraitError
from ..core import BaseWWTWidget, DEFAULT_SURVEYS_URL
WWT_HTML_FILE = os.path.join(os.path.dirname(__file__), '..', 'static', 'wwt.html')
WWT_HTML_FILE = os.path.join(os.path.dirname(__file__), '..', 'nbextension', 'static', 'wwt.html')
with open(WWT_HTML_FILE) as f:
WWT_HTML = f.read()

Просмотреть файл

@ -5,6 +5,7 @@
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
from glob import glob
from os.path import join as pjoin
@ -47,8 +48,10 @@ data_files_spec = [
('share/jupyter/nbextensions/pywwt',
nb_path, '*.js*'),
('share/jupyter/lab/extensions', lab_path, '*.tgz'),
('etc/jupyter/nbconfig/notebook.d' , HERE, 'pywwt.json')
]
('etc/jupyter/nbconfig/notebook.d' ,
os.path.join(HERE, 'jupyter.d', 'notebook.d'), 'pywwt.json'),
('etc/jupyter/jupyter_notebook_config.d' ,
os.path.join(HERE, 'jupyter.d', 'jupyter_notebook_config.d'), 'pywwt.json')]
cmdclass = create_cmdclass('jsdeps', package_data_spec=package_data_spec,