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

Rewrite server extension to run Panel applications in kernels #3763

Merged
merged 21 commits into from Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Expand Up @@ -65,22 +65,18 @@ jobs:
- name: doit develop_install
if: steps.install.outputs.cache-hit != 'true'
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
pip install pyecharts idom
- name: bokeh_sampledata
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
bokeh sampledata
- name: doit test_unit
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit test_unit
- name: test examples
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit test_examples
- name: Upload coverage to Codecov
Expand All @@ -103,6 +99,7 @@ jobs:
shell: bash -l {0}
env:
DESC: "Python ${{ matrix.python-version }} tests"
PANEL_LOG_LEVEL: info
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
# Without this env var `doit env_create ...` uses by default
Expand All @@ -119,9 +116,12 @@ jobs:
cache: true
playwright: true
id: install
- name: enable extension
run: |
conda activate test-environment
jupyter server extension enable panel.io.jupyter_server_extension --sys-prefix
- name: doit test_ui
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit test_ui
- name: Upload coverage to Codecov
Expand Down
14 changes: 14 additions & 0 deletions doc/developer_guide/index.md
Expand Up @@ -58,6 +58,20 @@ doit develop_install -c pyviz/label/dev -c conda-forge -c bokeh -o build -o test

The above command installs Panel's dependencies using conda, then performs a pip editable install of Panel. If it fails, `nodejs>=14.0.0` may be missing from your environment, fix it with `conda install -c conda-forge nodejs` then rerun above command.

## Enable the Jupyter extension

If you are running UI tests or intend to use the Panel Preview feature in Jupyter you must enable the server extension. To enable the classic notebook server extension:

```bash
jupyter serverextension enable panel.io.jupyter_server_extension --sys-prefix
```

For Jupyter Server:

```bash
jupyter server extension enable panel.io.jupyter_server_extension --sys-prefix
```

## Setting up pre-commit

Panel uses [pre-commit](https://pre-commit.com/) to automatically apply linting to Panel code. If you intend to contribute to Panel we recommend you enable it with:
Expand Down
@@ -0,0 +1,7 @@
{
"NotebookApp": {
"nbserver_extensions": {
"panel.io.jupyter_server_extension": true
}
}
}
113 changes: 0 additions & 113 deletions panel/_templates/auth_error.html

This file was deleted.

100 changes: 100 additions & 0 deletions panel/_templates/error.html
@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<title>{{ title|default("Panel Error", true) }}</title>

<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- FONT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600&Lato|Work+Sans:400,700&display=swap" rel="stylesheet" type='text/css'>

<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="apple-touch-icon" sizes="180x180" href="https://static.bokeh.org/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://panel.holoviz.org/_static/favicon.ico">
<link rel="manifest" href="https://static.bokeh.org/favicon/site.webmanifest">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<script type="module" src="https://unpkg.com/@microsoft/fast-colors@5.1.0"></script>
<script type="module" src="https://unpkg.com/@microsoft/fast-components@1.13.0"></script>
<style>
html {
height:100%;
}
html, #body-design-provider {
min-height: 100vh;
}
body {
margin: 0px;
padding: 0;
font-style: normal;
font-variant-ligatures: normal;
font-variant-caps: normal;
font-variant-numeric: normal;
font-variant-east-asian: normal;
font-weight: normal;
font-stretch: normal;
font-size: 16px;
line-height: normal;
font-family: aktiv-grotesk, "Segoe UI", Arial, Helvetica, sans-serif;
overflow-y: scroll;
}
.header {
background-image: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) ),url('{{base_url|default("", true) }}static/extensions/panel/images/index_background.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.header-grid {
/* Grid styles */
padding: 4rem 2rem;
display: grid;
align-items: center;
grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
}
#title {
background: transparent;
}
#subtitle {
font-size: 2em;
font-weight: bold;
margin-left: 2em;
color: white;
}
.error-message {
text-align: center;
}
#panel-logo {
width: 300px;
}
{% block extra_style %}{% endblock %}
</style>
</head>
<body>
<fast-design-system-provider id="body-design-provider" use-defaults background-color="#ffffff">
<fast-design-system-provider id="header-design-provider" use-defaults background-color="#000000">
<section class="header">
<div class="header-grid">
<h1>
<fast-anchor id="title" href="https://panel.holoviz.org" appearance="neutral" target="_self"><img id="panel-logo" src="https://panel.holoviz.org/_static/logo_horizontal.png"/></fast-anchor>
<fast-tooltip anchor="title">Click to visit the Panel web site</fast-tooltip>
</h1>
<span id="subtitle">{{ error_type|default("Error", true) }}: {{ error }}</span>
</div>
</section>
</fast-design-system-provider>
<section class="error-message">
{% block content %}
<h3>Error Message: {{ error_msg }}</h3>
{% endblock %}
</section>
<fast-divider></fast-divider>
</fast-design-system-provider>
</body>
</html>