Skip to content

Commit 46e685b

Browse files
authored
Adopt sp-repo-review (#1324)
1 parent 1cb4116 commit 46e685b

Some content is hidden

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

55 files changed

+341
-282
lines changed

.github/workflows/python-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ jobs:
7979
steps:
8080
- uses: actions/checkout@v4
8181
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
82-
- name: Run Linters
83-
run: |
82+
- name: Run Linters
83+
run: |
8484
hatch run typing:test
8585
hatch run lint:style
8686
pipx run interrogate -v .

.pre-commit-config.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ci:
22
autoupdate_schedule: monthly
3+
autoupdate_commit_msg: "chore: update pre-commit hooks"
34

45
repos:
56
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -28,14 +29,47 @@ repos:
2829
rev: 0.7.17
2930
hooks:
3031
- id: mdformat
32+
additional_dependencies:
33+
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3134

32-
- repo: https://github.com/psf/black
35+
- repo: https://github.com/pre-commit/mirrors-prettier
36+
rev: "v3.0.2"
37+
hooks:
38+
- id: prettier
39+
types_or: [yaml, html, json]
40+
41+
- repo: https://github.com/adamchainz/blacken-docs
42+
rev: "1.16.0"
43+
hooks:
44+
- id: blacken-docs
45+
additional_dependencies: [black==23.7.0]
46+
47+
- repo: https://github.com/psf/black-pre-commit-mirror
3348
rev: 23.7.0
3449
hooks:
3550
- id: black
3651

52+
- repo: https://github.com/codespell-project/codespell
53+
rev: "v2.2.5"
54+
hooks:
55+
- id: codespell
56+
args: ["-L", "sur,nd"]
57+
58+
- repo: https://github.com/pre-commit/pygrep-hooks
59+
rev: "v1.10.0"
60+
hooks:
61+
- id: rst-backticks
62+
- id: rst-directive-colons
63+
- id: rst-inline-touching-normal
64+
3765
- repo: https://github.com/astral-sh/ruff-pre-commit
3866
rev: v0.0.287
3967
hooks:
4068
- id: ruff
41-
args: ["--fix"]
69+
args: ["--fix", "--show-fixes"]
70+
71+
- repo: https://github.com/scientific-python/cookie
72+
rev: "2023.08.23"
73+
hooks:
74+
- id: sp-repo-review
75+
additional_dependencies: ["repo-review[cli]"]

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ All notable changes to this project will be documented in this file.
271271

272272
### Bugs fixed
273273

274-
- Reapply preferred_dir fix, now with better backwards compatability [#1162](https://github.com/jupyter-server/jupyter_server/pull/1162) ([@vidartf](https://github.com/vidartf))
274+
- Reapply preferred_dir fix, now with better backwards compatibility [#1162](https://github.com/jupyter-server/jupyter_server/pull/1162) ([@vidartf](https://github.com/vidartf))
275275

276276
### Maintenance and upkeep improvements
277277

@@ -1055,7 +1055,7 @@ All notable changes to this project will be documented in this file.
10551055

10561056
### Bugs fixed
10571057

1058-
- Regression in connection URL calcuation in ServerApp [#761](https://github.com/jupyter-server/jupyter_server/pull/761) ([@jhamet93](https://github.com/jhamet93))
1058+
- Regression in connection URL calculation in ServerApp [#761](https://github.com/jupyter-server/jupyter_server/pull/761) ([@jhamet93](https://github.com/jhamet93))
10591059
- Include explicit package data [#757](https://github.com/jupyter-server/jupyter_server/pull/757) ([@blink1073](https://github.com/blink1073))
10601060
- Ensure terminal cwd exists [#755](https://github.com/jupyter-server/jupyter_server/pull/755) ([@fcollonval](https://github.com/fcollonval))
10611061
- make 'cwd' param for TerminalManager absolute [#749](https://github.com/jupyter-server/jupyter_server/pull/749) ([@rccern](https://github.com/rccern))
@@ -1947,7 +1947,7 @@ This was a broken release and was yanked from PyPI.
19471947

19481948
### Added
19491949

1950-
- ([#191](https://github.com/jupyter/jupyter_server/pull/191)) Async kernel managment is now possible using the `AsyncKernelManager` from `jupyter_client`
1950+
- ([#191](https://github.com/jupyter/jupyter_server/pull/191)) Async kernel management is now possible using the `AsyncKernelManager` from `jupyter_client`
19511951
- ([#201](https://github.com/jupyter/jupyter_server/pull/201)) Parameters can now be passed to new terminals created by the `terminals` REST API.
19521952

19531953
### Changed

CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ from any directory in your system with::
4040

4141
Code Styling and Quality Checks
4242
-------------------------------
43-
`jupyter_server` has adopted automatic code formatting so you shouldn't
43+
``jupyter_server`` has adopted automatic code formatting so you shouldn't
4444
need to worry too much about your code style.
4545
As long as your code is valid,
4646
the pre-commit hook should take care of how it should look.
47-
`pre-commit` and its associated hooks will automatically be installed when
47+
``pre-commit`` and its associated hooks will automatically be installed when
4848
you run ``pip install -e ".[test]"``
4949

5050
To install ``pre-commit`` hook manually, run the following::

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
]
4545

4646
try:
47-
import enchant # type:ignore # noqa
47+
import enchant # type:ignore[import] # noqa
4848

4949
extensions += ["sphinxcontrib.spelling"]
5050
except ImportError:

docs/source/developers/contents.rst

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -109,39 +109,39 @@ model. There are three model types: **notebook**, **file**, and **directory**.
109109
110110
# Notebook Model with Content
111111
{
112-
'content': {
113-
'metadata': {},
114-
'nbformat': 4,
115-
'nbformat_minor': 0,
116-
'cells': [
112+
"content": {
113+
"metadata": {},
114+
"nbformat": 4,
115+
"nbformat_minor": 0,
116+
"cells": [
117117
{
118-
'cell_type': 'markdown',
119-
'metadata': {},
120-
'source': 'Some **Markdown**',
118+
"cell_type": "markdown",
119+
"metadata": {},
120+
"source": "Some **Markdown**",
121121
},
122122
],
123123
},
124-
'created': datetime(2015, 7, 25, 19, 50, 19, 19865),
125-
'format': 'json',
126-
'last_modified': datetime(2015, 7, 25, 19, 50, 19, 19865),
127-
'mimetype': None,
128-
'name': 'a.ipynb',
129-
'path': 'foo/a.ipynb',
130-
'type': 'notebook',
131-
'writable': True,
124+
"created": datetime(2015, 7, 25, 19, 50, 19, 19865),
125+
"format": "json",
126+
"last_modified": datetime(2015, 7, 25, 19, 50, 19, 19865),
127+
"mimetype": None,
128+
"name": "a.ipynb",
129+
"path": "foo/a.ipynb",
130+
"type": "notebook",
131+
"writable": True,
132132
}
133133
134134
# Notebook Model without Content
135135
{
136-
'content': None,
137-
'created': datetime.datetime(2015, 7, 25, 20, 17, 33, 271931),
138-
'format': None,
139-
'last_modified': datetime.datetime(2015, 7, 25, 20, 17, 33, 271931),
140-
'mimetype': None,
141-
'name': 'a.ipynb',
142-
'path': 'foo/a.ipynb',
143-
'type': 'notebook',
144-
'writable': True
136+
"content": None,
137+
"created": datetime.datetime(2015, 7, 25, 20, 17, 33, 271931),
138+
"format": None,
139+
"last_modified": datetime.datetime(2015, 7, 25, 20, 17, 33, 271931),
140+
"mimetype": None,
141+
"name": "a.ipynb",
142+
"path": "foo/a.ipynb",
143+
"type": "notebook",
144+
"writable": True,
145145
}
146146
147147
@@ -227,21 +227,28 @@ return for a more complete implementation.
227227
228228
class NoOpCheckpoints(GenericCheckpointsMixin, Checkpoints):
229229
"""requires the following methods:"""
230+
230231
def create_file_checkpoint(self, content, format, path):
231-
""" -> checkpoint model"""
232+
"""-> checkpoint model"""
233+
232234
def create_notebook_checkpoint(self, nb, path):
233-
""" -> checkpoint model"""
235+
"""-> checkpoint model"""
236+
234237
def get_file_checkpoint(self, checkpoint_id, path):
235-
""" -> {'type': 'file', 'content': <str>, 'format': {'text', 'base64'}}"""
238+
"""-> {'type': 'file', 'content': <str>, 'format': {'text', 'base64'}}"""
239+
236240
def get_notebook_checkpoint(self, checkpoint_id, path):
237-
""" -> {'type': 'notebook', 'content': <output of nbformat.read>}"""
241+
"""-> {'type': 'notebook', 'content': <output of nbformat.read>}"""
242+
238243
def delete_checkpoint(self, checkpoint_id, path):
239244
"""deletes a checkpoint for a file"""
245+
240246
def list_checkpoints(self, path):
241247
"""returns a list of checkpoint models for a given file,
242248
default just does one per file
243249
"""
244250
return []
251+
245252
def rename_checkpoint(self, checkpoint_id, old_path, new_path):
246253
"""renames checkpoint from old path to new path"""
247254

0 commit comments

Comments
 (0)