Skip to content

Commit c2e7fa8

Browse files
committed
Merge branch 'master' into remove-travis
2 parents 37ef1b8 + c5dbbb6 commit c2e7fa8

File tree

137 files changed

+6069
-8626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+6069
-8626
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Jupyter Server Tests
22
on:
33
push:
44
branches:
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: [ '3.6', '3.7', '3.8' ]
15+
python-version: [ '3.5', '3.6', '3.7', '3.8' ]
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v1
@@ -26,4 +26,4 @@ jobs:
2626
pip install -e .[test]
2727
- name: Run the tests
2828
run: |
29-
nosetests -v jupyter_server
29+
pytest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ src
3333
*.swp
3434
*.map
3535
.idea/
36+
.vscode/
3637
Read the Docs
3738
config.rst
3839

@@ -41,3 +42,4 @@ config.rst
4142

4243
package-lock.json
4344
geckodriver.log
45+
yarn.lock

.travis.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# http://travis-ci.org/#!/ipython/ipython
2+
language: python
3+
4+
cache:
5+
directories:
6+
- $HOME/.cache/bower
7+
- $HOME/.cache/pip
8+
env:
9+
global:
10+
- PATH=$TRAVIS_BUILD_DIR/pandoc:$PATH
11+
matrix:
12+
- GROUP=python
13+
14+
before_install:
15+
- pip install --upgrade pip
16+
- pip install --upgrade setuptools wheel nose coverage codecov
17+
- |
18+
if [[ $GROUP == docs ]]; then
19+
pip install -r docs/doc-requirements.txt
20+
pip install --upgrade pytest
21+
fi
22+
23+
install:
24+
- pip install --pre .[test] $EXTRA_PIP
25+
- pip freeze
26+
- wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb
27+
28+
script:
29+
- jupyter kernelspec list
30+
- |
31+
symlinks=$(find . -type l| grep -v './git-hooks')
32+
if [[ $(echo $symlinks) ]]; then
33+
echo "Repository contains symlinks which won't work on windows:"
34+
echo $symlinks
35+
echo ""
36+
false
37+
else
38+
true
39+
fi
40+
- 'if [[ $GROUP == python ]]; then pytest; fi'
41+
- |
42+
if [[ $GROUP == docs ]]; then
43+
EXIT_STATUS=0
44+
make -C docs/ html || EXIT_STATUS=$?
45+
46+
if [[ $TRAVIS_EVENT_TYPE == cron ]]; then
47+
make -C docs/ linkcheck || EXIT_STATUS=$?;
48+
fi
49+
50+
exit $EXIT_STATUS
51+
fi
52+
53+
matrix:
54+
include:
55+
- python: 3.5
56+
env: GROUP=python
57+
- python: 3.6
58+
env: GROUP=python
59+
- python: 3.7
60+
env: GROUP=python
61+
- python: 3.8
62+
env: GROUP=python
63+
- python: 3.5
64+
env: GROUP=docs
65+
- python: 3.6
66+
env: GROUP=docs
67+
- python: 3.7
68+
env: GROUP=docs
69+
- python: 3.8
70+
env: GROUP=docs
71+
72+
after_success:
73+
- codecov

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.2.1] - 2020-1-10
11+
12+
### Added
13+
14+
- **pytest-plugin** for Jupyter Server.
15+
- Allows one to write async/await syntax in tests functions.
16+
- Some particularly useful fixtures include:
17+
- `serverapp`: a default ServerApp instance that handles setup+teardown.
18+
- `configurable_serverapp`: a function that returns a ServerApp instance.
19+
- `fetch`: an awaitable function that tests makes requests to the server API
20+
- `create_notebook`: a function that writes a notebook to a given temporary file path.
21+
22+
## [0.2.0] - 2019-12-19
23+
24+
### Added
25+
- `extension` submodule ([#48](https://github.com/jupyter/jupyter_server/pull/48))
26+
- ExtensionApp - configurable JupyterApp-subclass for server extensions
27+
- Most useful for Jupyter frontends, like Notebook, JupyterLab, nteract, voila etc.
28+
- Launch with entrypoints
29+
- Configure from file or CLI
30+
- Add custom templates, static assets, handlers, etc.
31+
- Static assets are served behind a `/static/<extension_name>` endpoint.
32+
- Run server extensions in "standalone mode" ([#70](https://github.com/jupyter/jupyter_server/pull/70) and [#76](https://github.com/jupyter/jupyter_server/pull/76))
33+
- ExtensionHandler - tornado handlers for extensions.
34+
- Finds static assets at `/static/<extension_name>`
35+
36+
### Changed
37+
- `jupyter serverextension <command>` entrypoint has been changed to `jupyter server extension <command>`.
38+
- `toggle_jupyter_server` and `validate_jupyter_server` function no longer take a Logger object as an argument.
39+
- Changed testing framework from nosetests to pytest ([#152](https://github.com/jupyter/jupyter_server/pull/152))
40+
- Depend on pytest-tornasync extension for handling tornado/asyncio eventloop
41+
- Depend on pytest-console-scripts for testing CLI entrypoints
42+
- Added Github actions as a testing framework along side Travis and Azure ([#146](https://github.com/jupyter/jupyter_server/pull/146))
43+
44+
### Removed
45+
- Removed the option to update `root_dir` trait in FileContentsManager and MappingKernelManager in ServerApp ([#135](https://github.com/jupyter/jupyter_server/pull/135))
46+
47+
### Fixed
48+
- Synced Jupyter Server with Notebook PRs in batches (ended on 2019-09-27)
49+
- [Batch 1](https://github.com/jupyter/jupyter_server/pull/95)
50+
- [Batch 2](https://github.com/jupyter/jupyter_server/pull/97)
51+
- [Batch 3](https://github.com/jupyter/jupyter_server/pull/98)
52+
- [Batch 4](https://github.com/jupyter/jupyter_server/pull/99)
53+
- [Batch 5](https://github.com/jupyter/jupyter_server/pull/103)
54+
- [Batch 6](https://github.com/jupyter/jupyter_server/pull/104)
55+
- [Batch 7](https://github.com/jupyter/jupyter_server/pull/105)
56+
- [Batch 8](https://github.com/jupyter/jupyter_server/pull/106)
57+
58+
### Security
59+
- Added a "secure_write to function for cookie/token saves ([#77](https://github.com/jupyter/jupyter_server/pull/77))

CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To run the Python tests, use::
6969

7070
If you want coverage statistics as well, you can run::
7171

72-
py.test --cov notebook -v --pyargs jupyter_server
72+
py.test --cov notebook -v
7373

7474
Building the Documentation
7575
--------------------------
@@ -82,7 +82,7 @@ containing all the necessary packages (except pandoc), use::
8282

8383
conda env create -f docs/environment.yml
8484
source activate server_docs # Linux and OS X
85-
activate notebook_docs # Windows
85+
activate server_docs # Windows
8686

8787
.. _conda environment:
8888
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Jupyter Server
22

33
[![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https://groups.google.com/forum/#!forum/jupyter)
4-
[![Build Status](https://travis-ci.org/jupyter/jupyter_server.svg?branch=master)](https://travis-ci.org/jupyter/jupyter_server)
4+
[![Build Status](https://github.com/jupyter/jupyter_server/workflows/CI/badge.svg)](https://github.com/jupyter/jupyter_server/actions)
55
[![Documentation Status](https://readthedocs.org/projects/jupyter-server/badge/?version=latest)](http://jupyter-server.readthedocs.io/en/latest/?badge=latest)
66

77
The Jupyter Server provides the backend for Jupyter web applications such as
@@ -21,11 +21,23 @@ You can find the installation documentation for the
2121
The documentation for advanced usage of Jupyter notebook can be found
2222
[here](https://jupyter-server.readthedocs.io/en/latest/).
2323

24-
For a local installation, make sure you have
24+
To install the latest release locally, make sure you have
2525
[pip installed](https://pip.readthedocs.io/en/stable/installing/) and run:
2626

2727
$ pip install jupyter_server
2828

29+
### Versioning and Branches
30+
31+
If Jupyter Server is a dependency of your project/application, it is important that you pin it to a version that works for your application. Currently, Jupyter Server only has minor and patch versions. Different minor versions likely include API-changes while patch versions do not change API.
32+
33+
When a new minor version in released on PyPI, a branch for that version will be created in this repository, and the version of the master branch will be bumped to the next minor version number. That way, the master branch always reflects the latest un-released version.
34+
35+
To see the changes between releases, checkout the [CHANGELOG](https://github.com/jupyter/jupyter_server/blob/master/CHANGELOG.md).
36+
37+
To install the latest patch of a given version:
38+
39+
$ pip install jupyter_server>=0.2
40+
2941
## Usage - Running Jupyter Server
3042

3143
### Running in a local installation

appveyor.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,36 @@ matrix:
44

55
environment:
66
matrix:
7+
- CONDA_PY: 35
8+
CONDA_PY_SPEC: 3.5
9+
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
710
- CONDA_PY: 36
11+
CONDA_PY_SPEC: 3.6
812
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
913
- CONDA_PY: 37
10-
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
14+
CONDA_PY_SPEC: 3.7
15+
CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64"
1116
- CONDA_PY: 38
12-
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
17+
CONDA_PY_SPEC: 3.8
18+
# appveyor doesn't come with this directory, so use 37's since we're creating an env anyway
19+
CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64"
1320

1421
platform:
1522
- x64
1623

17-
build: off
24+
build: false
1825

1926
install:
2027
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
28+
- cmd: set CONDA_PY=%CONDA_PY%
29+
- cmd: set CONDA_PY_SPEC=%CONDA_PY_SPEC%
2130
- cmd: conda config --set show_channel_urls true
2231
- cmd: conda config --add channels conda-forge
23-
#- cmd: conda update --yes --quiet conda
24-
- cmd: conda install -y pyzmq tornado jupyter_client nbformat nbconvert ipykernel pip nose
25-
- cmd: pip install .[test]
32+
- cmd: conda update --yes --quiet conda
33+
- cmd: conda info -a
34+
- cmd: conda create -y -q -n test-env-%CONDA_PY% python=%CONDA_PY_SPEC% pip pyzmq tornado jupyter_client nbformat nbconvert nose
35+
- cmd: conda activate test-env-%CONDA_PY%
36+
- cmd: pip install -e .[test]
2637

2738
test_script:
28-
- nosetests -v jupyter_server --exclude-dir jupyter_server\tests\selenium
39+
- pytest -s -v

docs/source/changelog.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ We strongly recommend that you upgrade to version 9+ of pip before upgrading ``j
2121
Use ``pip install pip --upgrade`` to upgrade pip. Check pip version with
2222
``pip --version``.
2323

24+
.. _release-0.0.2:
25+
26+
0.0.2
27+
-----
28+
29+
- Introduce new extension module
30+
- Pytest for unit tests
31+
- Server documentation
32+
- NbClassic for migration from notebook
33+
2434
.. _release-0.0.1:
2535

2636
0.0.1
2737
-----
2838

29-
First release of the Jupyter Server.
39+
- First release of the Jupyter Server.

docs/source/extending/handlers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ following:
115115
Called when the extension is loaded.
116116
117117
Args:
118-
nb_server_app (NotebookWebApplication): handle to the Notebook webserver instance.
118+
nb_server_app: handle to the Notebook webserver instance.
119119
"""
120120
web_app = nb_server_app.web_app
121121
host_pattern = '.*$'

docs/source/frontends.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Jupyter Server does not come with a frontend out-of-the-box; instead, a frontend
1111
Writing a frontend application
1212
------------------------------
1313

14-
Jupyter Server provides two key classes for writing a server frontend:
14+
Jupyter Server provides two key classes for writing a server frontend:
1515

1616
- ``ExtensionApp``
17-
- ``ExtensionHandler``
17+
- ``ExtensionHandlerMixin``
1818

1919
The ExtensionApp:
2020

@@ -28,7 +28,7 @@ To create a new Jupyter frontend application, subclass the ``ExtensionApp`` like
2828

2929
.. code-block:: python
3030
31-
from jupyter_server.extension import ExtensionApp
31+
from jupyter_server.extension.application import ExtensionApp
3232
3333
3434
class MyFrontend(ExtensionApp):
@@ -38,7 +38,7 @@ To create a new Jupyter frontend application, subclass the ``ExtensionApp`` like
3838
default_url = 'myfrontend'
3939
load_other_extensions = True
4040
41-
# --- ExtensionApp traits you can configure ---
41+
# --- ExtensionApp traits you can configure ---
4242
static_paths = [...]
4343
template_paths = [...]
4444
settings = {...}
@@ -61,7 +61,7 @@ To create a new Jupyter frontend application, subclass the ``ExtensionApp`` like
6161
def initialize_templates(self):
6262
...
6363
# Change the jinja templating environment
64-
self.settings.update({'myfrontend_jinja2_env': ...})
64+
self.settings.update({'myfrontend_jinja2_env': ...})
6565
6666
The ``ExtensionApp`` uses the following methods and properties to connect your frontend to the Jupyter server. Overwrite these pieces to add your custom settings, handlers and templates:
6767

@@ -81,13 +81,13 @@ Properties
8181
Writing frontend handlers
8282
-------------------------
8383

84-
To write handlers for an ``ExtensionApp``, use the ``ExtensionHandler`` class. This class routes Tornado's ``static_url`` attribute to the ``/static/<extension_name>/`` namespace where your frontend's static files will be served.
84+
To write handlers for an ``ExtensionApp``, use the ``ExtensionHandlerMixin`` class. This class routes Tornado's ``static_url`` attribute to the ``/static/<extension_name>/`` namespace where your frontend's static files will be served.
8585

8686
.. code-block:: python
8787
88-
from jupyter_server.extension import ExtensionHandler
88+
from jupyter_server.extension.handler import ExtensionHandlerMixin
8989
90-
class MyFrontendHandler(ExtensionHandler):
90+
class MyFrontendHandler(ExtensionHandlerMixin, JupyterHandler):
9191
9292
urls = ['/myfrontend/hello']
9393
@@ -97,7 +97,7 @@ To write handlers for an ``ExtensionApp``, use the ``ExtensionHandler`` class. T
9797
def post(self):
9898
...
9999
100-
ExtensionHandler comes with the following properties:
100+
ExtensionHandlerMixin comes with the following properties:
101101

102102
* ``config``: the ExtensionApp's config object.
103103
* ``server_config``: the ServerApp's config object.
@@ -121,7 +121,7 @@ To make your frontend executable from anywhere on your system, added this method
121121
122122
from setuptools import setup
123123
124-
124+
125125
setup(
126126
name='myfrontend',
127127
...
@@ -131,3 +131,9 @@ To make your frontend executable from anywhere on your system, added this method
131131
]
132132
}
133133
)
134+
135+
Examples
136+
--------
137+
138+
You can check some simple example on the `GitHub jupyter_server repository
139+
<https://github.com/jupyter/jupyter_server/tree/master/examples/simple>`_.

0 commit comments

Comments
 (0)