Skip to content

Commit 2450cec

Browse files
authored
Merge branch 'main' into jupyter_server_terminals
2 parents aff97aa + 64555ff commit 2450cec

File tree

9 files changed

+71
-44
lines changed

9 files changed

+71
-44
lines changed

.github/workflows/enforce-label.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
enforce-label:
88
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
911
steps:
1012
- name: enforce-triage-label
1113
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/python-tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,26 @@ jobs:
4343
run: |
4444
codecov
4545
46+
pre-commit:
47+
name: pre-commit
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
- uses: actions/setup-python@v2
52+
- uses: pre-commit/action@v2.0.0
53+
with:
54+
extra_args: --all-files --hook-stage=manual
55+
- name: Help message if pre-commit fail
56+
if: ${{ failure() }}
57+
run: |
58+
echo "You can install pre-commit hooks to automatically run formatting"
59+
echo "on each commit with:"
60+
echo " pre-commit install"
61+
echo "or you can run by hand on staged files with"
62+
echo " pre-commit run"
63+
echo "or after-the-fact on already committed files with"
64+
echo " pre-commit run --all-files --hook-stage=manual"
65+
4666
test_docs_and_examples:
4767
name: Test Docs and Examples
4868
timeout-minutes: 10

.github/workflows/trigger_precommit.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
ci:
2-
skip: [check-jsonschema]
3-
41
repos:
52
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.1.0
3+
rev: v4.2.0
74
hooks:
85
- id: end-of-file-fixer
96
- id: check-case-conflict
@@ -32,22 +29,23 @@ repos:
3229
args: [--profile=black]
3330

3431
- repo: https://github.com/pre-commit/mirrors-prettier
35-
rev: v2.6.1
32+
rev: v2.6.2
3633
hooks:
3734
- id: prettier
3835

3936
- repo: https://github.com/asottile/pyupgrade
40-
rev: v2.31.1
37+
rev: v2.32.0
4138
hooks:
4239
- id: pyupgrade
4340
args: [--py37-plus]
4441

4542
- repo: https://github.com/PyCQA/doc8
46-
rev: 0.11.0
43+
rev: 0.11.1
4744
hooks:
4845
- id: doc8
4946
args: [--max-line-length=200]
5047
exclude: docs/source/other/full-config.rst
48+
stages: [manual]
5149

5250
- repo: https://github.com/pycqa/flake8
5351
rev: 4.0.1
@@ -59,17 +57,20 @@ repos:
5957
"flake8-logging-format==0.6.0",
6058
"flake8-implicit-str-concat==0.2.0",
6159
]
60+
stages: [manual]
6261

6362
- repo: https://github.com/pre-commit/mirrors-eslint
64-
rev: v8.12.0
63+
rev: v8.13.0
6564
hooks:
6665
- id: eslint
66+
stages: [manual]
6767

6868
- repo: https://github.com/sirosen/check-jsonschema
69-
rev: 0.14.1
69+
rev: 0.14.2
7070
hooks:
7171
- id: check-jsonschema
7272
name: "Check GitHub Workflows"
7373
files: ^\.github/workflows/
7474
types: [yaml]
7575
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
76+
stages: [manual]

CONTRIBUTING.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,17 @@ You can invoke the pre-commit hook by hand at any time with::
5959

6060
which should run any autoformatting on your code
6161
and tell you about any errors it couldn't fix automatically.
62-
You may also install [black integration](https://github.com/psf/black#editor-integration)
62+
You may also install `black integration <https://github.com/psf/black#editor-integration>`_
6363
into your text editor to format code automatically.
6464

6565
If you have already committed files before setting up the pre-commit
6666
hook with ``pre-commit install``, you can fix everything up using
6767
``pre-commit run --all-files``. You need to make the fixing commit
6868
yourself after that.
6969

70+
Some of the hooks only run on CI by default, but you can invoke them by
71+
running with the ``--hook-stage manual`` argument.
72+
7073
Troubleshooting the Installation
7174
--------------------------------
7275

docs/source/contributors/team-meetings.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ Team Meetings, Road Map and Calendar
55

66
Many of the lead Jupyter Server developers meet weekly over Zoom. These meetings are open to everyone.
77

8-
To see when the next meeting is happening, watch this Github issue:
8+
To see when the next meeting is happening and how to attend, watch this Github issue:
99

10-
https://github.com/jupyter/jupyter_server/issues/126
10+
https://github.com/jupyter-server/team-compass/issues/15
11+
12+
Meeting Notes
13+
-------------
14+
15+
- `2022 <https://github.com/jupyter-server/team-compass/issues/15>`_
16+
- `2021 <https://github.com/jupyter-server/team-compass/issues/4>`_
17+
- `2019-2020 <https://github.com/jupyter-server/team-compass/issues/1>`_
18+
19+
Roadmap
20+
-------
1121

1222
Also check out Jupyter Server's roadmap where we track future plans for Jupyter Server:
1323

14-
https://github.com/jupyter/jupyter_server/issues/127
24+
`Jupyter Server 2.0 Discussion <https://github.com/jupyter-server/team-compass/issues/24>`_
1525

26+
`Archived roadmap <https://github.com/jupyter/jupyter_server/issues/127>`_
1627

17-
Jupyter Calendar:
28+
Jupyter Calendar
29+
----------------
1830

1931
.. raw:: html
2032

docs/source/developers/savehooks.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,15 @@ A post-save hook to make a script equivalent whenever the notebook is saved
8282
8383
This could be a simple call to ``jupyter nbconvert --to script``, but spawning
8484
the subprocess every time is quite slow.
85+
86+
.. note::
87+
Assigning a new hook to e.g. ``c.FileContentsManager.pre_save_hook`` will override any existing one.
88+
89+
If you want to add new hooks and keep existing ones, you should use e.g.:
90+
91+
.. code-block:: python
92+
93+
contents_manager.register_pre_save_hook(script_pre_save)
94+
contents_manager.register_post_save_hook(script_post_save)
95+
96+
Hooks will then be called in the order they were registered.

jupyter_server/gateway/managers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def start_kernel(self, kernel_id=None, path=None, **kwargs):
7272
kwargs["cwd"] = self.cwd_for_path(path)
7373

7474
km = self.kernel_manager_factory(parent=self, log=self.log)
75-
await km.start_kernel(**kwargs)
75+
await km.start_kernel(kernel_id=kernel_id, **kwargs)
7676
kernel_id = km.kernel_id
7777
self._kernels[kernel_id] = km
7878

@@ -368,6 +368,7 @@ async def refresh_model(self, model=None):
368368
self.log.debug("Request kernel at: %s" % self.kernel_url)
369369
try:
370370
response = await gateway_request(self.kernel_url, method="GET")
371+
371372
except web.HTTPError as error:
372373
if error.status_code == 404:
373374
self.log.warning("Kernel not found at: %s" % self.kernel_url)
@@ -434,14 +435,14 @@ async def start_kernel(self, **kwargs):
434435
response = await gateway_request(self.kernels_url, method="POST", body=json_body)
435436
self.kernel = json_decode(response.body)
436437
self.kernel_id = self.kernel["id"]
438+
self.kernel_url = url_path_join(self.kernels_url, url_escape(str(self.kernel_id)))
437439
self.log.info(f"GatewayKernelManager started kernel: {self.kernel_id}, args: {kwargs}")
438440
else:
439441
self.kernel_id = kernel_id
442+
self.kernel_url = url_path_join(self.kernels_url, url_escape(str(self.kernel_id)))
440443
self.kernel = await self.refresh_model()
441444
self.log.info(f"GatewayKernelManager using existing kernel: {self.kernel_id}")
442445

443-
self.kernel_url = url_path_join(self.kernels_url, url_escape(str(self.kernel_id)))
444-
445446
async def shutdown_kernel(self, now=False, restart=False):
446447
"""Attempts to stop the kernel process cleanly via HTTP."""
447448

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ filterwarnings = [
2828
[tool.jupyter-releaser]
2929
skip = ["check-links"]
3030

31+
[tool.jupyter-releaser.options]
32+
post-version-spec = "dev"
33+
3134
[tool.tbump.version]
3235
current = "1.16.1.dev0"
3336
regex = '''

0 commit comments

Comments
 (0)