Skip to content

Commit

Permalink
Switch away from inline resources in notebook (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Aug 21, 2020
1 parent 697f640 commit 04c73ca
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
- conda config --set always_yes True
# ...and now install doit/pyctdev into miniconda
- conda install -c pyviz "pyctdev>=0.5" && doit ecosystem_setup
- conda install nodejs
- echo "//registry.npmjs.org/:_authToken=$NPM_API_TOKEN" > $HOME/.npmrc
- npm whoami
install:
- doit env_create $CHANS_DEV --python=$PYTHON_VERSION
- source activate test-environment
Expand All @@ -81,10 +84,13 @@ jobs:
- &conda_pkg
<<: *conda_default
stage: conda_dev_package
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID LABELS=$LABELS_DEV CHANS="-c pyviz/label/dev -c bokeh"
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID NPM_TAG="--tag dev" LABELS=$LABELS_DEV CHANS="-c pyviz/label/dev -c bokeh"
install:
- doit package_build $CHANS $PKG_TEST_PYTHON --test-group=unit_deploy
script: doit package_upload --token=$ANACONDA_TOKEN $LABELS
script:
- doit package_upload --token=$ANACONDA_TOKEN $LABELS
- cd panel
- npm publish $NPM_TAG

- &pip_pkg
<<: *conda_default
Expand All @@ -102,7 +108,7 @@ jobs:

- <<: *conda_pkg
stage: conda_package
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID LABELS=$LABELS_REL CHANS="-c pyviz -c bokeh"
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID NPM_TAG="--tag latest" LABELS=$LABELS_REL CHANS="-c pyviz -c bokeh"

- <<: *pip_pkg
env: PYPI=pypi PYPIUSER=$PPU PYPIPASS=$PPP
Expand Down
8 changes: 1 addition & 7 deletions panel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from __future__ import absolute_import, division, unicode_literals

import param as _param

from . import layout # noqa
from . import links # noqa
from . import pane # noqa
from . import param # noqa
from . import pipeline # noqa
from . import widgets # noqa

from .config import config, panel_extension as extension # noqa
from .config import config, panel_extension as extension, __version__ # noqa
from .depends import depends # noqa
from .interact import interact # noqa
from .io import ipywidget, serve, state # noqa
Expand All @@ -20,7 +18,3 @@
from .pane import panel, Pane # noqa
from .param import Param # noqa
from .template import Template # noqa

__version__ = str(_param.version.Version(
fpath=__file__, archive_commit="$Format:%h$", reponame="panel"))

6 changes: 5 additions & 1 deletion panel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
from .io.notebook import load_notebook
from .io.state import state

__version__ = str(param.version.Version(
fpath=__file__, archive_commit="$Format:%h$", reponame="panel"))

_LOCAL_DEV_VERSION = any(v in __version__ for v in ('post', 'dirty'))

#---------------------------------------------------------------------
# Public API
Expand Down Expand Up @@ -135,7 +139,7 @@ class _config(param.Parameterized):
_oauth_extra_params = param.Dict(default={}, doc="""
Additional parameters required for OAuth provider.""")

_inline = param.Boolean(default=True, allow_None=True, doc="""
_inline = param.Boolean(default=_LOCAL_DEV_VERSION, allow_None=True, doc="""
Whether to inline JS and CSS resources. If disabled, resources
are loaded from CDN if one is available.""")

Expand Down
2 changes: 1 addition & 1 deletion panel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@holoviz/panel",
"version": "0.9.5",
"version": "0.10.0a20",
"description": "A high level dashboarding library for python visualization libraries.",
"license": "BSD-3-Clause",
"repository": {
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@ def run(self):
if 'develop' not in sys.argv and 'egg_info' not in sys.argv:
pyct.build.examples(example_path, __file__, force=True)

version = setup_args['version']
if 'post' not in version:
with open('./panel/package.json') as f:
package_json = json.load(f)
js_version = package_json['version']
if version != js_version:
raise ValueError("panel.js version (%s) does not match "
"panel version (%s). Cannot build release."
% (js_version, version))

setup(**setup_args)

if os.path.isdir(example_path):
Expand Down

0 comments on commit 04c73ca

Please sign in to comment.