Skip to content

Commit ba2c6f5

Browse files
chore: update pre-commit hooks (#401)
* chore: update pre-commit hooks updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0) - [github.com/python-jsonschema/check-jsonschema: 0.28.1 → 0.28.4](python-jsonschema/check-jsonschema@0.28.1...0.28.4) - [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0) - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0) - [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.4.7](astral-sh/ruff-pre-commit@v0.3.5...v0.4.7) - [github.com/scientific-python/cookie: 2024.03.10 → 2024.04.23](scientific-python/cookie@2024.03.10...2024.04.23) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * cleanup * lint * lint --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <[email protected]>
1 parent 60b6151 commit ba2c6f5

10 files changed

+38
-37
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
pipx run doc8 --max-line-length=200
7272
7373
docs:
74-
runs-on: windows-latest
74+
runs-on: ubuntu-latest
7575
steps:
7676
- uses: actions/checkout@v4
7777
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

.pre-commit-config.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
7+
rev: v4.6.0
88
hooks:
99
- id: check-case-conflict
1010
- id: check-ast
@@ -21,7 +21,7 @@ repos:
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/python-jsonschema/check-jsonschema
24-
rev: 0.28.1
24+
rev: 0.28.4
2525
hooks:
2626
- id: check-github-workflows
2727

@@ -43,10 +43,10 @@ repos:
4343
additional_dependencies: [black==23.7.0]
4444

4545
- repo: https://github.com/codespell-project/codespell
46-
rev: "v2.2.6"
46+
rev: "v2.3.0"
4747
hooks:
4848
- id: codespell
49-
args: ["-L", "sur,nd"]
49+
args: ["-L", "sur,nd,assertin"]
5050

5151
- repo: https://github.com/pre-commit/pygrep-hooks
5252
rev: "v1.10.0"
@@ -56,7 +56,7 @@ repos:
5656
- id: rst-inline-touching-normal
5757

5858
- repo: https://github.com/pre-commit/mirrors-mypy
59-
rev: "v1.9.0"
59+
rev: "v1.10.0"
6060
hooks:
6161
- id: mypy
6262
files: "^nbformat"
@@ -65,7 +65,7 @@ repos:
6565
["jsonschema>=2.6", "traitlets>=5.13", "jupyter_core>5.4"]
6666

6767
- repo: https://github.com/astral-sh/ruff-pre-commit
68-
rev: v0.3.5
68+
rev: v0.4.7
6969
hooks:
7070
- id: ruff
7171
types_or: [python, jupyter]
@@ -76,7 +76,7 @@ repos:
7676
types_or: [python, jupyter]
7777

7878
- repo: https://github.com/scientific-python/cookie
79-
rev: "2024.03.10"
79+
rev: "2024.04.23"
8080
hooks:
8181
- id: sp-repo-review
8282
additional_dependencies: ["repo-review[cli]"]

package.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"name": "nbformat-schema",
3-
"version": "5.10.4",
4-
"description": "JSON schemata for Jupyter notebook formats",
5-
"main": "index.js",
6-
"files": [
7-
"nbformat/v3/nbformat.v3.schema.json",
8-
"nbformat/v4/nbformat.v4.schema.json"
9-
],
10-
"repository": {
11-
"type": "git",
12-
"url": "git+https://github.com/jupyter/nbformat.git"
13-
},
14-
"keywords": [
15-
"jupyter",
16-
"notebook",
17-
"json-schema"
18-
],
19-
"author": "Project Jupyter Contributors",
20-
"license": "BSD-3-Clause",
21-
"bugs": {
22-
"url": "https://github.com/jupyter/nbformat/issues"
23-
},
24-
"homepage": "https://nbformat.readthedocs.io"
2+
"name": "nbformat-schema",
3+
"version": "5.10.4",
4+
"description": "JSON schemata for Jupyter notebook formats",
5+
"main": "index.js",
6+
"files": [
7+
"nbformat/v3/nbformat.v3.schema.json",
8+
"nbformat/v4/nbformat.v4.schema.json"
9+
],
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/jupyter/nbformat.git"
13+
},
14+
"keywords": [
15+
"jupyter",
16+
"notebook",
17+
"json-schema"
18+
],
19+
"author": "Project Jupyter Contributors",
20+
"license": "BSD-3-Clause",
21+
"bugs": {
22+
"url": "https://github.com/jupyter/nbformat/issues"
23+
},
24+
"homepage": "https://nbformat.readthedocs.io"
2525
}

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ ignore = [
174174
"RET503", # Missing explicit `return` at the end of function able...
175175
"S101", # Use of `assert` detected"
176176
"E731", # Do not assign a `lambda` expression"
177+
"UP031", # Use format specifiers instead of percent format
177178
]
178179
unfixable = [
179180
# Don't touch print statements

tests/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestsBase(unittest.TestCase):
1515

1616
@classmethod
1717
def fopen(cls, f, mode="r", encoding="utf-8"):
18-
return open(os.path.join(cls._get_files_path(), f), mode, encoding=encoding) # noqa
18+
return open(os.path.join(cls._get_files_path(), f), mode, encoding=encoding) # noqa: SIM115
1919

2020
@classmethod
2121
def _get_files_path(cls):

tests/test_sign.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def sign_stdin(nb):
220220
env = os.environ.copy()
221221
env["JUPYTER_DATA_DIR"] = self.data_dir
222222
p = Popen(
223-
[sys.executable, "-m", "nbformat.sign", "--log-level=0"], # noqa
223+
[sys.executable, "-m", "nbformat.sign", "--log-level=0"], # noqa: S603
224224
stdin=PIPE,
225225
stdout=PIPE,
226226
env=env,

tests/v3/formattest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
def open_utf8(fname, mode):
14-
return open(fname, mode=mode, encoding="utf-8") # noqa
14+
return open(fname, mode=mode, encoding="utf-8") # noqa: SIM115
1515

1616

1717
class NBFormatTest:

tests/v3/test_nbpy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TestPy(formattest.NBFormatTest, TestCase):
1212
nb0_ref = nb0_py
1313
ext = "py"
1414
mod = nbpy
15-
ignored_keys = ["collapsed", "outputs", "prompt_number", "metadata"] # noqa
15+
ignored_keys = ["collapsed", "outputs", "prompt_number", "metadata"] # noqa: RUF012
1616

1717
def assertSubset(self, da, db):
1818
"""assert that da is a subset of db, ignoring self.ignored_keys.

tests/v4/formattest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
def open_utf8(fname, mode):
14-
return open(fname, mode=mode, encoding="utf-8") # noqa
14+
return open(fname, mode=mode, encoding="utf-8") # noqa: SIM115
1515

1616

1717
class NBFormatTest:

tests/v4/test_json.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_base_version_matches_latest(self):
120120
f"nbformat.v{nbformat}.{nbformat_minor}.schema.json",
121121
),
122122
encoding="utf-8",
123-
) as schema_file: # noqa
123+
) as schema_file: # noqa: PLW2901
124124
ver_schema = json.load(schema_file)
125125
assert latest_schema == ver_schema
126126

0 commit comments

Comments
 (0)