Skip to content

Commit

Permalink
Branch 0.12.7 (#3263)
Browse files Browse the repository at this point in the history
* Fix jinja2 imports (#3258)

* fix: wrong offset when memoryview format is non-byte (#3206)

the offset should be in bytes, not elements. See also bokeh/ipywidgets_bokeh#46 (comment)

* Support jupyter server root_dir with lab extension (#3172)

Jupyter sends path relative to the root_dir which can be different from the cwd. This commit fixes the lab extension for panel preview to account for root_dir.

Reference: #3170

* DOC: add note on enabling panel widget on Jupyter Lab (#3029)

* Remove redundant and confusing JupyterLab install instructions (#3037)

* Remove reference to Python 2 and link to Travis

* Remove redondant install instructions to work with Jupyter

* Update CHANGELOG

* Add setuptools to build requirements

* use https instead of the git:// protocol in GHA (#3092)

* Try to switch to setuptools (#3138)

* Try to switch to setuptools

* Continue on error

* CI: fix Macos tests workflow (#3160)

* attempt to fix CI on macos

* forgot bokeh channel

* remove strict setting

* reset strict and add pyctdev channel

* remove continue_on_error and test py310

* clean up test workflow

* add comment about PYCTDEV_SELF_CHANNEL

* remove py310

* Revert change to build backend

* Update setuptools pin

* Pin setuptools

* Further pin updates

* Pin setuptools (#3265)

* Fix image_url test

* Pin pyvista

* Bump panel.js version

* Fix GH workflows

* Bump panel.js version

Co-authored-by: Maarten Breddels <[email protected]>
Co-authored-by: Govinda Totla <[email protected]>
Co-authored-by: Ray Bell <[email protected]>
Co-authored-by: Maxime Liquet <[email protected]>
  • Loading branch information
5 people authored Mar 27, 2022
1 parent d778801 commit 8b0dc3d
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: conda setup
run: |
conda config --set always_yes True
conda install "pip<21.2.1"
conda install "pip<21.2.1" "setuptools<61"
conda install -c pyviz "pyctdev>=0.5"
doit ecosystem_setup
- name: conda build
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda install ${{ env.CHANS_DEV }} "pip<21.2.1"
conda install ${{ env.CHANS_DEV }} "pip<21.2.1" "setuptools<61"
doit develop_install $CHANS_DEV -o build
pip uninstall -y panel
doit pip_on_conda
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda install ${{ env.CHANS_DEV }} "pip<21.2.1"
conda install ${{ env.CHANS_DEV }} "pip<21.2.1" "setuptools<61"
conda list
doit develop_install ${{ env.CHANS_DEV}} -o doc -o examples
pip install pydeck sphinxcontrib-napoleon sphinx-copybutton pyecharts
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:
shell: bash -l {0}
env:
DESC: "Python ${{ matrix.python-version }} tests"
HV_REQUIREMENTS: "unit_tests"
PYTHON_VERSION: ${{ matrix.python-version }}
CHANS_DEV: "-c pyviz/label/dev -c bokeh/label/dev -c conda-forge"
CHANS: "-c pyviz -c bokeh/label/dev -c conda-forge"
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Without this env var `doit env_create ...` uses by default
# the `pyviz` channel, except that we don't want to configure
# it as one of the sources.
PYCTDEV_SELF_CHANNEL: "pyviz/label/dev"
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -41,39 +42,39 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channel-priority: strict
channels: pyviz/label/dev,bokeh/label/dev,conda-forge,nodefaults
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow
- name: conda setup
run: |
conda config --set always_yes True
conda install -c pyviz "pyctdev>=0.5"
doit ecosystem_setup
conda install -c conda-forge "nodejs=15.3.0"
doit env_create ${{ env.CHANS_DEV}} --python=${{ matrix.python-version }}
conda install "pyctdev>=0.5"
conda install "nodejs=15.3.0"
doit env_create --python=${{ matrix.python-version }}
- name: nix_opengl
if: contains(matrix.os, 'ubuntu')
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
sudo apt-get install libglu1-mesa
conda install -c conda-forge mesalib
conda install mesalib
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x24
sleep 3
- name: doit develop_install
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
conda install ${{ env.CHANS_DEV }} "pip<21.2.1"
conda install "pip<21.2.1" "setuptools<61"
conda list
doit develop_install ${{ env.CHANS_DEV}} -o examples -o recommended -o tests -o build
doit develop_install -o examples -o recommended -o tests -o build
pip install pyecharts idom
bokeh sampledata
echo "-----"
git describe
- name: windows_opengl
if: contains(matrix.os, 'windows')
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
- name: doit env_capture
run: |
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Releases

## Version 0.12.7

Date: 2022-03-26

The 0.12.7 release primarily fixes an incompatibility with the new jinja2 3.1.0 release. Many thanks to @maartenbreddels, @govinda18, @raybellwaves and the maintainers @maximlt and @philippjfr for contributing further fixes to this release.

Bug fixes:

- Wrong offset when memoryview format is non-byte ([#3206](https://github.com/holoviz/panel/pull/3206))
- Support jupyter server root_dir with lab extension ([#3172](https://github.com/holoviz/panel/pull/3172))

Docs:

- add note on enabling panel widget on Jupyter Lab ([#3029](https://github.com/holoviz/panel/pull/3029))
- Remove redundant and confusing JupyterLab install instructions ([#3037](https://github.com/holoviz/panel/pull/3037))

Compatibility:

- Fix jinja2 imports ([#3258](https://github.com/holoviz/panel/pull/3258))

## Version 0.12.6

Date: 2021-12-08
Expand Down
3 changes: 3 additions & 0 deletions doc/FAQ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Conversely, what Panel adds on top of Bokeh is full bidirectional communication

**A:** This error usually means that you forgot to run panel.extension() in a notebook context to set up the code for communicating between JavaScript and Python. It's easy to get confused and think you don't need that line, because notebooks will often work fine as long as *some* notebook somewhere in your Jupyter session has run the command, but the only reliable way to make the communication channels available is to make sure *every* notebook includes this command.

**Q: How do I enable the panel widget on Jupyter Lab?**

**A:** Run `jupyter serverextension enable panel.io.jupyter_server_extension`.

**Q: Why is my object being shown using the wrong type of pane?**

Expand Down
7 changes: 1 addition & 6 deletions doc/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@ Installation

|CondaPyViz|_ |CondaDefaults|_ |PyPI|_ |License|_

Panel works with `Python 2.7 and Python 3 <https://travis-ci.org/pyviz/panel>`_ on Linux, Windows, or Mac. The recommended way to install Panel is using the `conda <http://conda.pydata.org/docs/>`_ command provided by `Anaconda <http://docs.continuum.io/anaconda/install>`_ or `Miniconda <http://conda.pydata.org/miniconda.html>`_::
Panel works with Python 3 on Linux, Windows, or Mac. The recommended way to install Panel is using the `conda <http://conda.pydata.org/docs/>`_ command provided by `Anaconda <http://docs.continuum.io/anaconda/install>`_ or `Miniconda <http://conda.pydata.org/miniconda.html>`_::

conda install -c pyviz panel

or using PyPI::

pip install panel

Support for classic Jupyter Notebook is included with Panel. If you want to work with JupyterLab, you will also need to install the optional PyViz JupyterLab extension::

conda install -c conda-forge jupyterlab
jupyter labextension install @pyviz/jupyterlab_pyviz


.. |CondaPyViz| image:: https://img.shields.io/conda/v/pyviz/panel.svg
.. _CondaPyViz: https://anaconda.org/pyviz/panel
Expand Down
21 changes: 21 additions & 0 deletions doc/releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Releases

## Version 0.12.7

Date: 2022-03-26

The 0.12.7 release primarily fixes an incompatibility with the new jinja2 3.1.0 release. Many thanks to @maartenbreddels, @govinda18, @raybellwaves and the maintainers @maximlt and @philippjfr for contributing further fixes to this release.

Bug fixes:

- Wrong offset when memoryview format is non-byte ([#3206](https://github.com/holoviz/panel/pull/3206))
- Support jupyter server root_dir with lab extension ([#3172](https://github.com/holoviz/panel/pull/3172))

Docs:

- add note on enabling panel widget on Jupyter Lab ([#3029](https://github.com/holoviz/panel/pull/3029))
- Remove redundant and confusing JupyterLab install instructions ([#3037](https://github.com/holoviz/panel/pull/3037))

Compatibility:

- Fix jinja2 imports ([#3258](https://github.com/holoviz/panel/pull/3258))


## Version 0.12.6

Date: 2021-12-07
Expand Down
2 changes: 1 addition & 1 deletion panel/io/ipywidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def send(self, stream, msg_type, content=None, parent=None, ident=None, buffers=
offsets = [start]

for buffer in buffers[:-1]:
start += len(buffer)
start += memoryview(buffer).nbytes
offsets.append(start)

u32 = lambda n: n.to_bytes(4, "big")
Expand Down
14 changes: 14 additions & 0 deletions panel/io/jupyter_server_extension.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from urllib.parse import urljoin

import tornado
import os

from bokeh.command.util import build_single_handler_application
from bokeh.embed.bundle import extension_dirs
Expand Down Expand Up @@ -65,6 +66,17 @@ class ServerApplicationProxy:
def __init__(self, app, **kw):
self._app = app

@property
def root_dir(self):
"""
Gets the root directory of the jupyter server app
This is useful as the path sent received by the handler
may be different from the root dir.
Reference: https://github.com/holoviz/panel/issues/3170
"""
return self._app.settings['server_root_dir']

def __getattr__(self, key):
return getattr(self._app, key)

Expand All @@ -81,6 +93,7 @@ def initialize(self, *args, **kws):
pass

async def get(self, path, *args, **kwargs):
path = os.path.join(self.application.root_dir, path)
if path in _APPS:
app, context = _APPS[path]
else:
Expand Down Expand Up @@ -122,6 +135,7 @@ def initialize(self, *args, **kwargs):
pass

async def open(self, path, *args, **kwargs):
path = os.path.join(self.application.root_dir, path)
_, context = _APPS[path]

token = self._token
Expand Down
4 changes: 3 additions & 1 deletion panel/io/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

from bokeh.resources import Resources as BkResources
from bokeh.settings import settings as _settings
from jinja2 import Environment, Markup, FileSystemLoader
from markupsafe import Markup
from jinja2.environment import Environment
from jinja2.loaders import FileSystemLoader

from ..util import url_path
from .state import state
Expand Down
4 changes: 2 additions & 2 deletions panel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.12.6",
"version": "0.12.7-rc.2",
"description": "A high level dashboarding library for python visualization libraries.",
"license": "BSD-3-Clause",
"repository": {
Expand Down
6 changes: 1 addition & 5 deletions panel/tests/pane/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ def test_load_from_stringio():

def test_loading_a_image_from_url():
"""Tests the loading of a image from a url"""
url = 'https://file-examples-com.github.io/uploads/2017/10/file_example_PNG_500kB.png'
url = 'https://raw.githubusercontent.com/holoviz/panel/master/doc/_static/logo.png'

image_pane = PNG(url)
image_data = image_pane._data()
assert b'PNG' in image_data


def test_loading_a_image_from_pathlib():
"""Tests the loading of a image from a pathlib"""
filepath = Path(__file__).parent.parent / "test_data" / "logo.png"
Expand All @@ -107,7 +106,6 @@ def test_loading_a_image_from_pathlib():
image_data = image_pane._data()
assert b'PNG' in image_data


def test_image_alt_text(document, comm):
"""Tests the loading of a image from a url"""
url = 'https://file-examples-com.github.io/uploads/2017/10/file_example_PNG_500kB.png'
Expand All @@ -117,7 +115,6 @@ def test_image_alt_text(document, comm):

assert 'alt=&quot;Some alt text&quot;' in model.text


def test_image_link_url(document, comm):
"""Tests the loading of a image from a url"""
url = 'https://file-examples-com.github.io/uploads/2017/10/file_example_PNG_500kB.png'
Expand All @@ -127,7 +124,6 @@ def test_image_link_url(document, comm):

assert model.text.startswith('&lt;a href=&quot;http://anaconda.org&quot;')


def test_pdf_embed(document, comm):
pdf_pane = PDF('https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')
model = pdf_pane.get_root(document, comm)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
requires = [
"param >=1.9.0",
"pyct >=0.4.4",
"setuptools >=30.3.0",
"setuptools >=42,<61",
"bokeh >=2.4.0,<2.5.0",
"pyviz_comms >=0.6.0",
"requests",
"bleach",
"packaging",
"tqdm >=4.48.0"
]
]
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def run(self):
install_requires = [
'bokeh >=2.4.0,<2.5.0',
'param >=1.10.0',
'setuptools >=42,<61',
'pyviz_comms >=0.7.4',
'markdown',
'requests',
Expand Down Expand Up @@ -144,7 +145,7 @@ def run(self):
'jupyter_bokeh >=3.0.2',
'django <4',
'channels',
'pyvista',
'pyvista <0.33',
'ipywidgets',
'ipywidgets_bokeh',
'ipyvolume',
Expand All @@ -170,8 +171,8 @@ def run(self):
extras_require['build'] = [
'param >=1.9.2',
'pyct >=0.4.4',
'setuptools >=30.3.0',
'bokeh >=2.0.0',
'setuptools >=42,<61',
'bokeh >=2.4.0,<2.5.0',
'pyviz_comms >=0.6.0',
'bleach',
'tqdm'
Expand Down Expand Up @@ -207,6 +208,8 @@ def run(self):
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
Expand Down

0 comments on commit 8b0dc3d

Please sign in to comment.