Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter polish #221

Merged
merged 10 commits into from
Jul 23, 2019
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/docs/_static/embed-bundle.js
/docs/_static/embed-bundle.js.map
/package-lock.json
/pywwt/labextension
/pywwt/nbextension/static/index.js
/pywwt/nbextension/static/index.js.map

# Compiled files
*.py[cod]
*.a
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ notifications:
env:
global:
- SETUP_XVFB=True
- CONDA_CHANNELS="astrofrog/label/dev conda-forge"
- CONDA_CHANNELS="wwt/label/dev conda-forge"
- CONDA_DEPENDENCIES="astropy qtpy traitlets ipywidgets>=7.0 ipyevents widgetsnbextension pyqt pytest pytest-cov>=2.6.1 pytest-remotedata>=0.3.1 requests nomkl matplotlib beautifulsoup4 lxml jupyterlab flask flask-cors pyopengl"
- PIP_DEPENDENCIES="sphinx-automodapi numpydoc sphinx_rtd_theme pytest-faulthandler codecov reproject"
- PIP_DEPENDENCIES="sphinx-automodapi numpydoc sphinx_rtd_theme codecov reproject"
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.5
- PYTHON_VERSION=3.6
- PYTHON_VERSION=3.7

install:
- git clone git://github.com/astropy/ci-helpers.git
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ environment:
# of 32 bit and 64 bit builds are needed, move this
# to the matrix section.

CONDA_CHANNELS: "astrofrog/label/dev conda-forge"
CONDA_CHANNELS: "wwt/label/dev conda-forge"
# Without the pyqt version constraint, a lib compat issue leads to import failures on qtpy for Python 3.6:
CONDA_DEPENDENCIES: "astropy qtpy traitlets ipywidgets>=7.0 ipyevents widgetsnbextension pyqt==5.6.0 pytest pytest-cov>=2.6.1 pytest-remotedata>=0.3.1 requests matplotlib flask flask-cors pyopengl"
PIP_DEPENDENCIES: "pytest-faulthandler codecov reproject"
PIP_DEPENDENCIES: "codecov reproject"

matrix:
- PYTHON_VERSION: "2.7"
- PYTHON_VERSION: "3.5"
- PYTHON_VERSION: "3.6"
- PYTHON_VERSION: "3.7"

# matrix:
# fast_finish: true
Expand Down
11 changes: 11 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ If you want to use the Jupyter widget, you will also need to run::

jupyter nbextension install --py --symlink --sys-prefix pywwt
jupyter nbextension enable --py --sys-prefix pywwt
jupyter nbextension list # check that the output shows pywwt as enabled and OK
jupyter serverextension enable --py --sys-prefix pywwt
jupyter serverextension list # check that the output shows pywwt as enabled and OK

And if you additionally want to use the widget in JupyterLab, run::

jupyter labextension install .
jupyter labextension list # check that the output shows pywwt as enabled and OK

Besides ``pywwt``, the ``@jupyter-widgets/jupyterlab-manager`` and
``ipyevents`` lab-extensions must be installed and enabled.

If you use conda, you can alternatively install a recent developer version
using::
Expand Down
40 changes: 8 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,28 @@
},
"license": "BSD-3-Clause",
"author": "",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/WorldWideTelescope/pywwt"
},
"main": "lib/index.js",
"files": [
"lib/*.js"
],
"scripts": {
"build": "npm run build:nbextension",
"build": "npm run build:labextension && npm run build:nbextension",
"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",
"clean": "npm run clean:labextension && npm run clean:nbextension",
"clean:labextension": "rimraf pywwt/labextension",
"clean:nbextension": "rimraf pywwt/nbextension/static/index.js",
"test": "npm run test:firefox",
"test:chrome": "karma start --browsers=Chrome tests/karma.conf.js",
"test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true tests/karma.conf.js",
"test:firefox": "karma start --browsers=Firefox tests/karma.conf.js",
"test:ie": "karma start --browsers=IE tests/karma.conf.js",
"watch": "npm-run-all -p watch:*",
"watch:nbextension": "webpack --watch"
"clean:nbextension": "rimraf pywwt/nbextension/static/index.js"
},
"dependencies": {
"@jupyter-widgets/base": "^1.0.1"
"@jupyter-widgets/base": "^2.0.1"
},
"devDependencies": {
"@phosphor/application": "^1.5.0",
"@phosphor/widgets": "^1.5.0",
"@types/expect.js": "^0.3.29",
"@types/mocha": "^2.2.41",
"@types/node": "^8.0.17",
"expect.js": "^0.3.1",
"fs-extra": "^4.0.2",
"json-loader": "^0.5.7",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.3",
"karma-typescript": "^3.0.5",
"mkdirp": "^0.5.1",
"mocha": "^3.5.0",
"npm-run-all": "^4.1.1",
"rimraf": "^2.6.2",
"source-map-loader": "^0.2.1",
"typescript": "~2.4.2",
"webpack": "^3.4.1"
},
"jupyterlab": {
Expand Down
2 changes: 1 addition & 1 deletion pywwt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def _jupyter_nbextension_paths():
return [{'section': 'notebook',
'src': 'static',
'src': 'nbextension/static',
'dest': 'pywwt',
'require': 'pywwt/extension'}]

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
cmdclass = create_cmdclass('jsdeps', package_data_spec=package_data_spec,
data_files_spec=data_files_spec)
cmdclass['jsdeps'] = combine_commands(
install_npm(HERE, build_cmd='build:all'),
install_npm(HERE, build_cmd='build'),
ensure_targets(jstargets),
)

Expand Down Expand Up @@ -92,6 +92,7 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Framework :: Jupyter',
],
include_package_data = True,
Expand Down
3 changes: 1 addition & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var loaders = [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.js$/, loader: "source-map-loader" },
];

Expand Down Expand Up @@ -29,7 +28,7 @@ module.exports = [
entry: './lib/index.js',
output: {
filename: 'embed-bundle.js',
path: __dirname + '/docs/source/_static',
path: __dirname + '/docs/_static',
library: "pywwt",
libraryTarget: 'amd'
},
Expand Down