Skip to content

Commit 0a2942c

Browse files
authored
Adopt sp-repo-review (#377)
* adopt sp-repo-review * address lint * address typings * address typing * handle xfail * fix skip * skip it * address typing * try sphinx workaround * fix version handling * fix version handling
1 parent ea7f642 commit 0a2942c

20 files changed

+231
-176
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
steps:
6464
- uses: actions/checkout@v4
6565
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
66-
- name: Run Linters
67-
run: |
66+
- name: Run Linters
67+
run: |
6868
hatch run typing:test
6969
hatch run lint:style
7070
pipx run interrogate -v nbformat

.pre-commit-config.yaml

Lines changed: 34 additions & 3 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
@@ -29,14 +30,44 @@ repos:
2930
hooks:
3031
- id: mdformat
3132

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

50+
- repo: https://github.com/codespell-project/codespell
51+
rev: "v2.2.5"
52+
hooks:
53+
- id: codespell
54+
args: ["-L", "sur,nd"]
55+
56+
- repo: https://github.com/pre-commit/pygrep-hooks
57+
rev: "v1.10.0"
58+
hooks:
59+
- id: rst-backticks
60+
- id: rst-directive-colons
61+
- id: rst-inline-touching-normal
62+
3763
- repo: https://github.com/astral-sh/ruff-pre-commit
3864
rev: v0.0.287
3965
hooks:
4066
- id: ruff
41-
args: ["--fix"]
42-
exclude: script
67+
args: ["--fix", "--show-fixes"]
68+
69+
- repo: https://github.com/scientific-python/cookie
70+
rev: "2023.08.23"
71+
hooks:
72+
- id: sp-repo-review
73+
additional_dependencies: ["repo-review[cli]"]

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ python:
1111
build:
1212
os: ubuntu-22.04
1313
tools:
14-
python: "3.11"
14+
python: "3.11"

RELEASING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
nbformat = 4
1515

1616
# current minor version
17-
nbformat_minor = <new_minor_version_here>
17+
nbformat_minor = new_minor_version_here
1818

1919
# schema files for (major, minor) version tuples. (None, None) means the current version
2020
nbformat_schema = {
21-
(None, None): 'nbformat.v4.schema.json',
22-
(4, 0): 'nbformat.v4.0.schema.json',
23-
...
24-
(4, <new_minor_version_here>): 'nbformat.v4.<new_minor_version_here>.schema.json'
21+
(None, None): "nbformat.v4.schema.json",
22+
(4, 0): "nbformat.v4.0.schema.json",
23+
# ...
24+
(4, new_minor_version_here): "nbformat.v4.<new_minor_version_here>.schema.json",
2525
}
2626
```
2727

@@ -59,7 +59,7 @@ git push upstream --tags
5959
rm -rf dist/*
6060
rm -rf build/*
6161
pipx run build .
62-
# Double check the dist/* files have the right verison (no `.dev`) and install the wheel to ensure it's good
62+
# Double check the dist/* files have the right version (no `.dev`) and install the wheel to ensure it's good
6363
pip install dist/*
6464
pipx run twine upload dist/*
6565
```

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
import os
2121
import shutil
22-
from importlib.metadata import version as get_version
22+
23+
import nbformat
2324

2425
HERE = os.path.abspath(os.path.dirname(__file__))
2526

@@ -73,7 +74,7 @@
7374
# built documents.
7475
#
7576
# The short X.Y version.
76-
version = ".".join(get_version("nbformat").split(".")[:2])
77+
version = ".".join(nbformat.__version__.split(".")[:2])
7778
# The full version, including alpha/beta/rc tags.
7879
release = version
7980

0 commit comments

Comments
 (0)