Skip to content

Commit bd8aa7d

Browse files
committed
Merge branch 'master' into jupyter_telemetry
2 parents b06f7d6 + 7f81846 commit bd8aa7d

File tree

126 files changed

+5345
-11537
lines changed

Some content is hidden

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

126 files changed

+5345
-11537
lines changed

.github/workflows/codeql-analysis.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
# ******** NOTE ********
12+
13+
name: "CodeQL"
14+
15+
on:
16+
push:
17+
branches: [ '*' ]
18+
pull_request:
19+
# The branches below must be a subset of the branches above
20+
branches: [ master ]
21+
schedule:
22+
- cron: '25 18 * * 4'
23+
24+
jobs:
25+
analyze:
26+
name: Analyze
27+
runs-on: ubuntu-latest
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
language: [ 'python' ]
33+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
34+
# Learn more...
35+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v2
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v1
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50+
queries: security-and-quality
51+
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
- name: Autobuild
55+
uses: github/codeql-action/autobuild@v1
56+
57+
# ℹ️ Command-line programs to run using the OS shell.
58+
# 📚 https://git.io/JvXDl
59+
60+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61+
# and modify them (or add more) to build your code if your project
62+
# uses a compiled language
63+
64+
#- run: |
65+
# make bootstrap
66+
# make release
67+
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@v1

.github/workflows/main.yml

+35-9
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ on:
66
branches: '*'
77
jobs:
88
build:
9-
runs-on: ${{ matrix.os }}
9+
runs-on: ${{ matrix.os }}-latest
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-latest, macos-latest, windows-latest]
14-
python-version: [ '3.5', '3.6', '3.7', '3.8' ]
13+
os: [ubuntu, macos, windows]
14+
python-version: [ '3.6', '3.7', '3.8', '3.9', 'pypy3' ]
1515
exclude:
16-
- os: windows-latest
17-
python-version: '3.5'
18-
- os: windows-latest
19-
python-version: '3.6'
16+
- os: windows
17+
python-version: pypy3
2018
steps:
2119
- name: Checkout
2220
uses: actions/checkout@v1
@@ -25,9 +23,37 @@ jobs:
2523
with:
2624
python-version: ${{ matrix.python-version }}
2725
architecture: 'x64'
26+
- name: Upgrade packaging dependencies
27+
run: |
28+
pip install --upgrade pip setuptools wheel --user
29+
- name: Get pip cache dir
30+
id: pip-cache
31+
run: |
32+
echo "::set-output name=dir::$(pip cache dir)"
33+
- name: Cache pip
34+
uses: actions/cache@v1
35+
with:
36+
path: ${{ steps.pip-cache.outputs.dir }}
37+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
38+
restore-keys: |
39+
${{ runner.os }}-pip-${{ matrix.python-version }}-
40+
${{ runner.os }}-pip-
2841
- name: Install the Python dependencies
2942
run: |
30-
pip install -e .[test]
43+
pip install -e .[test] codecov
44+
- name: List installed packages
45+
run: |
46+
pip freeze
47+
pip check
3148
- name: Run the tests
3249
run: |
33-
pytest
50+
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
51+
- name: Install the Python dependencies for the examples
52+
run: |
53+
cd examples/simple && pip install -e .
54+
- name: Run the tests for the examples
55+
run: |
56+
pytest examples/simple/tests/test_handlers.py
57+
- name: Coverage
58+
run: |
59+
codecov

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ __pycache__
1919
.DS_Store
2020
\#*#
2121
.#*
22-
.coverage
22+
.coverage*
2323
.pytest_cache
2424
src
2525

CHANGELOG.md

+65-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.1.0] - 2020-12-11
11+
12+
[Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/1.0.10...1.1.0)
13+
14+
**Merged pull requests:**
15+
16+
- Restore pytest plugin from pytest-jupyter [\#360](https://github.com/jupyter-server/jupyter_server/pull/360) ([kevin-bates](https://github.com/kevin-bates))
17+
- Fix upgrade packaging dependencies build step [\#354](https://github.com/jupyter-server/jupyter_server/pull/354) ([mwakaba2](https://github.com/mwakaba2))
18+
- Await \_connect and inline read\_messages callback to \_connect [\#350](https://github.com/jupyter-server/jupyter_server/pull/350) ([ricklamers](https://github.com/ricklamers))
19+
- Update release instructions and dev version [\#348](https://github.com/jupyter-server/jupyter_server/pull/348) ([kevin-bates](https://github.com/kevin-bates))
20+
- Fix test\_trailing\_slash [\#346](https://github.com/jupyter-server/jupyter_server/pull/346) ([kevin-bates](https://github.com/kevin-bates))
21+
- Apply security advisory fix to master [\#345](https://github.com/jupyter-server/jupyter_server/pull/345) ([kevin-bates](https://github.com/kevin-bates))
22+
- Allow toggling auth for prometheus metrics [\#344](https://github.com/jupyter-server/jupyter_server/pull/344) ([yuvipanda](https://github.com/yuvipanda))
23+
- Port Notebook PRs 5565 and 5588 - terminal shell heuristics [\#343](https://github.com/jupyter-server/jupyter_server/pull/343) ([kevin-bates](https://github.com/kevin-bates))
24+
- Port gateway updates from notebook \(PRs 5317 and 5484\) [\#341](https://github.com/jupyter-server/jupyter_server/pull/341) ([kevin-bates](https://github.com/kevin-bates))
25+
- add check\_origin handler to gateway WebSocketChannelsHandler [\#340](https://github.com/jupyter-server/jupyter_server/pull/340) ([ricklamers](https://github.com/ricklamers))
26+
- Remove pytest11 entrypoint and plugin, require tornado 6.1, remove asyncio patch, CI work [\#339](https://github.com/jupyter-server/jupyter_server/pull/339) ([bollwyvl](https://github.com/bollwyvl))
27+
- Switch fixtures to use those in pytest-jupyter to avoid collisions [\#335](https://github.com/jupyter-server/jupyter_server/pull/335) ([kevin-bates](https://github.com/kevin-bates))
28+
- Enable CodeQL runs on all pushed branches [\#333](https://github.com/jupyter-server/jupyter_server/pull/333) ([kevin-bates](https://github.com/kevin-bates))
29+
- Asynchronous Contents API [\#324](https://github.com/jupyter-server/jupyter_server/pull/324) ([mwakaba2](https://github.com/mwakaba2))
30+
31+
32+
33+
## [1.0.6] - 2020-11-18
34+
35+
1.0.6 is a security release, fixing one vulnerability:
36+
37+
### Changed
38+
39+
- Fix open redirect vulnerability GHSA-grfj-wjv9-4f9v (CVE-2020-26232)
40+
41+
42+
## [1.0] - 2020-9-18
43+
44+
### Added.
45+
46+
* Added a basic, styled `login.html` template. ([220](https://github.com/jupyter/jupyter_server/pull/220), [295](https://github.com/jupyter/jupyter_server/pull/295))
47+
* Added new extension manager API for handling server extensions. ([248](https://github.com/jupyter/jupyter_server/pull/248), [265](https://github.com/jupyter/jupyter_server/pull/265), [275](https://github.com/jupyter/jupyter_server/pull/275), [303](https://github.com/jupyter/jupyter_server/pull/303))
48+
* The favicon and Jupyter logo are now available under jupyter_server's static namespace. ([284](https://github.com/jupyter/jupyter_server/pull/284))
49+
50+
### Changed.
51+
52+
* `load_jupyter_server_extension` should be renamed to `_load_jupyter_server_extension` in server extensions. Server now throws a warning when the old name is used. ([213](https://github.com/jupyter/jupyter_server/pull/213))
53+
* Docs for server extensions now recommend using `authenticated` decorator for handlers. ([219](https://github.com/jupyter/jupyter_server/pull/219))
54+
* `_load_jupyter_server_paths` should be renamed to `_load_jupyter_server_points` in server extensions. ([277](https://github.com/jupyter/jupyter_server/pull/277))
55+
* `static_url_prefix` in ExtensionApps is now a configurable trait. ([289](https://github.com/jupyter/jupyter_server/pull/289))
56+
* `extension_name` trait was removed in favor of `name`. ([232](https://github.com/jupyter/jupyter_server/pull/232))
57+
* Dropped support for Python 3.5. ([296](https://github.com/jupyter/jupyter_server/pull/296))
58+
* Made the `config_dir_name` trait configurable in `ConfigManager`. ([297](https://github.com/jupyter/jupyter_server/pull/297))
59+
60+
### Removed for now removed features.
61+
62+
* Removed ipykernel as a dependency of jupyter_server. ([255](https://github.com/jupyter/jupyter_server/pull/255))
63+
64+
### Fixed for any bug fixes.
65+
* Prevent a re-definition of prometheus metrics if `notebook` package already imports them. ([#210](https://github.com/jupyter/jupyter_server/pull/210))
66+
* Fixed `terminals` REST API unit tests that weren't shutting down properly. ([221](https://github.com/jupyter/jupyter_server/pull/221))
67+
* Fixed jupyter_server on Windows for Python < 3.7. Added patch to handle subprocess cleanup. ([240](https://github.com/jupyter/jupyter_server/pull/240))
68+
* `base_url` was being duplicated when getting a url path from the `ServerApp`. ([280](https://github.com/jupyter/jupyter_server/pull/280))
69+
* Extension URLs are now properly prefixed with `base_url`. Previously, all `static` paths were not. ([285](https://github.com/jupyter/jupyter_server/pull/285))
70+
* Changed ExtensionApp mixin to inherit from `HasTraits`. This broke in traitlets 5.0 ([294](https://github.com/jupyter/jupyter_server/pull/294))
71+
* Replaces `urlparse` with `url_path_join` to prevent URL squashing issues. ([304](https://github.com/jupyter/jupyter_server/pull/304))
72+
73+
1074
## [0.3] - 2020-4-22
1175

1276
### Added
@@ -74,4 +138,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
74138
- [Batch 8](https://github.com/jupyter/jupyter_server/pull/106)
75139

76140
### Security
77-
- Added a "secure_write to function for cookie/token saves ([#77](https://github.com/jupyter/jupyter_server/pull/77))
141+
- Added a "secure_write to function for cookie/token saves ([#77](https://github.com/jupyter/jupyter_server/pull/77))

MANIFEST.in

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
include COPYING.md
22
include CONTRIBUTING.rst
33
include README.md
4+
include RELEASE.md
5+
include CHANGELOG.md
46
include setupbase.py
5-
include Dockerfile
6-
graft tools
7+
8+
# include everything in package_data
9+
recursive-include jupyter_server *
710

811
# Event Schemas
912
graft jupyter_server/event-schemas
@@ -26,3 +29,5 @@ global-exclude *.pyc
2629
global-exclude *.pyo
2730
global-exclude .git
2831
global-exclude .ipynb_checkpoints
32+
global-exclude .pytest_cache
33+
global-exclude .coverage

README.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ To install the latest release locally, make sure you have
1414

1515
$ pip install jupyter_server
1616

17-
Jupyter Server currently supports the following Python versions:
18-
19-
Platform | Python
20-
--- | ---
21-
Linux | >=3.5
22-
OSX | >=3.5
23-
Windows | >=3.7
17+
Jupyter Server currently supports Python>=3.5 on Linux, OSX and Windows.
2418

2519
### Versioning and Branches
2620

@@ -45,12 +39,8 @@ If you are interested in contributing to the project, see [`CONTRIBUTING.rst`](C
4539

4640
## Team Meetings and Roadmap
4741

48-
When: Thursdays [8:00am, Pacific time](https://www.thetimezoneconverter.com/?t=8%3A00%20am&tz=San%20Francisco&)
49-
Where: [calpoly/jupyter Zoom](https://zoom.us/my/jovyan)
50-
What: [Meeting notes](https://github.com/jupyter/jupyter_server/issues/126)
51-
5242
* When: Thursdays [8:00am, Pacific time](https://www.thetimezoneconverter.com/?t=8%3A00%20am&tz=San%20Francisco&)
53-
* Where: [Jupyter Zoom](https://calpoly.zoom.us/my/jupyter)
43+
* Where: [Jovyan Zoom](https://zoom.us/my/jovyan?pwd=c0JZTHlNdS9Sek9vdzR3aTJ4SzFTQT09)
5444
* What: [Meeting notes](https://github.com/jupyter/jupyter_server/issues/126)
5545

5646
See our tentative [roadmap here](https://github.com/jupyter/jupyter_server/issues/127).

RELEASE.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Making a Jupyter Server Release
2+
To create a release, perform the following steps...
3+
4+
## Remove untracked files
5+
```
6+
git clean -dffx
7+
```
8+
9+
## Update the version and apply the tag
10+
```
11+
vim jupyter_server/_version.py
12+
export script_version=`python setup.py --version 2>/dev/null`
13+
git commit -a -m "Release $script_version"
14+
git tag $script_version
15+
```
16+
17+
## Build the artifacts
18+
```
19+
rm -rf dist
20+
python setup.py sdist
21+
python setup.py bdist_wheel
22+
```
23+
24+
## Update the version back to dev
25+
```
26+
vim jupyter_server/_version.py
27+
git commit -a -m "Back to dev version"
28+
```
29+
30+
## Push the commits and tag
31+
```
32+
git push --all
33+
git push --tags
34+
```
35+
36+
## Publish the artifacts to pypi
37+
```
38+
pip install twine
39+
twine check dist/*
40+
twine upload dist/*
41+
```

docs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Jupyter Server Docs Sources
2+
3+
Read [this page](https://jupyter-server.readthedocs.io/en/latest/contributors/contributing.html#building-the-docs) to build the docs.

docs/source/developers/contents.rst

+26-5
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,19 @@ methods:
192192
ContentsManager.is_hidden
193193

194194
You may be required to specify a Checkpoints object, as the default one,
195-
``FileCheckpoints``, could be incompatible with your custom
195+
``FileCheckpoints``, could be incompatible with your custom
196196
ContentsManager.
197197

198198
Customizing Checkpoints
199199
-----------------------
200200
.. currentmodule:: jupyter_server.services.contents.checkpoints
201201

202-
Customized Checkpoint definitions allows behavior to be
202+
Customized Checkpoint definitions allows behavior to be
203203
altered and extended.
204204

205205
The ``Checkpoints`` and ``GenericCheckpointsMixin`` classes
206206
(from :mod:`jupyter_server.services.contents.checkpoints`)
207-
have reusable code and are intended to be used together,
207+
have reusable code and are intended to be used together,
208208
but require the following methods to be implemented.
209209

210210
.. autosummary::
@@ -220,7 +220,7 @@ No-op example
220220
~~~~~~~~~~~~~
221221

222222
Here is an example of a no-op checkpoints object - note the mixin
223-
comes first. The docstrings indicate what each method should do or
223+
comes first. The docstrings indicate what each method should do or
224224
return for a more complete implementation.
225225

226226
.. code-block:: python
@@ -238,7 +238,7 @@ return for a more complete implementation.
238238
def delete_checkpoint(self, checkpoint_id, path):
239239
"""deletes a checkpoint for a file"""
240240
def list_checkpoints(self, path):
241-
"""returns a list of checkpoint models for a given file,
241+
"""returns a list of checkpoint models for a given file,
242242
default just does one per file
243243
"""
244244
return []
@@ -267,3 +267,24 @@ ContentsManager.
267267
.. _NBFormat: https://nbformat.readthedocs.io/en/latest/index.html
268268
.. _PGContents: https://github.com/quantopian/pgcontents
269269
.. _PostgreSQL: https://www.postgresql.org/
270+
271+
Asynchronous Support
272+
--------------------
273+
274+
An asynchronous version of the Contents API is available to run slow IO processes concurrently.
275+
276+
- :class:`~manager.AsyncContentsManager`
277+
- :class:`~filemanager.AsyncFileContentsManager`
278+
- :class:`~largefilemanager.AsyncLargeFileManager`
279+
- :class:`~checkpoints.AsyncCheckpoints`
280+
- :class:`~checkpoints.AsyncGenericCheckpointsMixin`
281+
282+
.. note::
283+
284+
.. _contentfree:
285+
286+
In most cases, the non-asynchronous Contents API is performant for local filesystems.
287+
However, if the Jupyter Notebook web application is interacting with a high-latent virtual filesystem, you may see performance gains by using the asynchronous version.
288+
For example, if you're experiencing terminal lag in the web application due to the slow and blocking file operations, the asynchronous version can reduce the lag.
289+
Before opting in, comparing both non-async and async options' performances is recommended.
290+

0 commit comments

Comments
 (0)