Skip to content

Commit 8aca33c

Browse files
committed
Merge branch 'master' into example
2 parents 4a64388 + 7cf9436 commit 8aca33c

32 files changed

+498
-398
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ jobs:
2424
- name: Install the Python dependencies
2525
run: |
2626
pip install -e .[test]
27-
- name: ipykernel fix on windows 3.8
28-
if: matrix.os == 'windows-latest' && matrix.python-version == '3.8'
29-
run: |
30-
pip install --upgrade git+https://github.com/ipython/ipykernel.git
3127
- name: Run the tests
3228
run: |
3329
pytest

.gitignore

Lines changed: 1 addition & 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

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

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.
1021

1122
## [0.2.0] - 2019-12-19
1223

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ environment:
2121
platform:
2222
- x64
2323

24-
build: off
24+
build: false
2525

2626
install:
2727
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
@@ -31,11 +31,9 @@ install:
3131
- cmd: conda config --add channels conda-forge
3232
- cmd: conda update --yes --quiet conda
3333
- cmd: conda info -a
34-
- cmd: conda create -y -q -n test-env-%CONDA_PY% python=%CONDA_PY_SPEC% pyzmq tornado jupyter_client nbformat nbconvert ipykernel pip nose
34+
- cmd: conda create -y -q -n test-env-%CONDA_PY% python=%CONDA_PY_SPEC% pip pyzmq tornado jupyter_client nbformat nbconvert nose
3535
- cmd: conda activate test-env-%CONDA_PY%
36-
- cmd: pip install .[test]
37-
# FIXME: Use patch for python 3.8, windows issues (https://github.com/ipython/ipykernel/pull/456) - remove once released
38-
- IF %CONDA_PY% == 38 pip install --upgrade git+https://github.com/ipython/ipykernel.git
36+
- cmd: pip install -e .[test]
3937

4038
test_script:
41-
- pytest
39+
- pytest -s -v

docs/source/frontends.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Writing a frontend application
1414
Jupyter Server provides two key classes for writing a server frontend:
1515

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

1919
The ExtensionApp:
2020

@@ -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 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.

jupyter_server/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
# Next beta/alpha/rc release: The version number for beta is X.Y.ZbN **without dots**.
1111

12-
version_info = (0, 2, 0, '.dev0')
12+
version_info = (0, 3, 0, '.dev')
1313
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])

jupyter_server/extension/application.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from jupyter_server.serverapp import ServerApp, aliases, flags
1919
from jupyter_server.transutils import _
2020
from jupyter_server.utils import url_path_join
21-
from .handler import ExtensionHandler
21+
from .handler import ExtensionHandlerMixin
2222

2323
# Remove alias for nested classes in ServerApp.
2424
# Nested classes are not allowed in ExtensionApp.
@@ -154,6 +154,7 @@ class method. This method can be set as a entry_point in
154154
help="Name of extension."
155155
)
156156

157+
@default('extension_name')
157158
def _extension_name_default(self):
158159
try:
159160
return self.name
@@ -163,8 +164,8 @@ def _extension_name_default(self):
163164
INVALID_EXTENSION_NAME_CHARS = [' ', '.', '+', '/']
164165

165166
@validate('extension_name')
166-
def _validate_extension_name(self, value):
167-
#value = self.extension_name
167+
def _validate_extension_name(self, proposal):
168+
value = proposal['value']
168169
if isinstance(value, str):
169170
# Validate that extension_name doesn't contain any invalid characters.
170171
for c in ExtensionApp.INVALID_EXTENSION_NAME_CHARS:
@@ -320,7 +321,7 @@ def _prepare_handlers(self):
320321

321322
# Get handler kwargs, if given
322323
kwargs = {}
323-
if issubclass(handler, ExtensionHandler):
324+
if issubclass(handler, ExtensionHandlerMixin):
324325
kwargs['extension_name'] = self.extension_name
325326
try:
326327
kwargs.update(handler_items[2])
@@ -351,6 +352,7 @@ def _prepare_templates(self):
351352
self.settings.update({
352353
"{}_template_paths".format(self.extension_name): self.template_paths
353354
})
355+
self.initialize_templates()
354356

355357
@staticmethod
356358
def initialize_server(argv=[], load_other_extensions=True, **kwargs):

jupyter_server/extension/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from jupyter_server.base.handlers import JupyterHandler, FileFindHandler
1+
from jupyter_server.base.handlers import FileFindHandler
22
from traitlets import Unicode, default
33

44

@@ -12,7 +12,7 @@ def get_template(self, name):
1212
return self.settings[env].get_template(name)
1313

1414

15-
class ExtensionHandler(JupyterHandler):
15+
class ExtensionHandlerMixin():
1616
"""Base class for Jupyter server extension handlers.
1717
1818
Subclasses can serve static files behind a namespaced

jupyter_server/prometheus/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Prometheus metrics exported by Jupyter Notebook Server
2+
Prometheus metrics exported by Jupyter Server
33
44
Read https://prometheus.io/docs/practices/naming/ for naming
55
conventions for metrics & labels.

0 commit comments

Comments
 (0)