Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update pre-commit hooks #401

Merged
merged 5 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
pipx run doc8 --max-line-length=200

docs:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand All @@ -21,7 +21,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.1
rev: 0.28.4
hooks:
- id: check-github-workflows

Expand All @@ -43,10 +43,10 @@ repos:
additional_dependencies: [black==23.7.0]

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.3.0"
hooks:
- id: codespell
args: ["-L", "sur,nd"]
args: ["-L", "sur,nd,assertin"]

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

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.7
hooks:
- id: ruff
types_or: [python, jupyter]
Expand All @@ -76,7 +76,7 @@ repos:
types_or: [python, jupyter]

- repo: https://github.com/scientific-python/cookie
rev: "2024.03.10"
rev: "2024.04.23"
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "nbformat-schema",
"version": "5.10.4",
"description": "JSON schemata for Jupyter notebook formats",
"main": "index.js",
"files": [
"nbformat/v3/nbformat.v3.schema.json",
"nbformat/v4/nbformat.v4.schema.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/jupyter/nbformat.git"
},
"keywords": [
"jupyter",
"notebook",
"json-schema"
],
"author": "Project Jupyter Contributors",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/jupyter/nbformat/issues"
},
"homepage": "https://nbformat.readthedocs.io"
"name": "nbformat-schema",
"version": "5.10.4",
"description": "JSON schemata for Jupyter notebook formats",
"main": "index.js",
"files": [
"nbformat/v3/nbformat.v3.schema.json",
"nbformat/v4/nbformat.v4.schema.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/jupyter/nbformat.git"
},
"keywords": [
"jupyter",
"notebook",
"json-schema"
],
"author": "Project Jupyter Contributors",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/jupyter/nbformat/issues"
},
"homepage": "https://nbformat.readthedocs.io"
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ ignore = [
"RET503", # Missing explicit `return` at the end of function able...
"S101", # Use of `assert` detected"
"E731", # Do not assign a `lambda` expression"
"UP031", # Use format specifiers instead of percent format
]
unfixable = [
# Don't touch print statements
Expand Down
2 changes: 1 addition & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestsBase(unittest.TestCase):

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

@classmethod
def _get_files_path(cls):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def sign_stdin(nb):
env = os.environ.copy()
env["JUPYTER_DATA_DIR"] = self.data_dir
p = Popen(
[sys.executable, "-m", "nbformat.sign", "--log-level=0"], # noqa
[sys.executable, "-m", "nbformat.sign", "--log-level=0"], # noqa: S603
stdin=PIPE,
stdout=PIPE,
env=env,
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/formattest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


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


class NBFormatTest:
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/test_nbpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestPy(formattest.NBFormatTest, TestCase):
nb0_ref = nb0_py
ext = "py"
mod = nbpy
ignored_keys = ["collapsed", "outputs", "prompt_number", "metadata"] # noqa
ignored_keys = ["collapsed", "outputs", "prompt_number", "metadata"] # noqa: RUF012

def assertSubset(self, da, db):
"""assert that da is a subset of db, ignoring self.ignored_keys.
Expand Down
2 changes: 1 addition & 1 deletion tests/v4/formattest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


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


class NBFormatTest:
Expand Down
2 changes: 1 addition & 1 deletion tests/v4/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_base_version_matches_latest(self):
f"nbformat.v{nbformat}.{nbformat_minor}.schema.json",
),
encoding="utf-8",
) as schema_file: # noqa
) as schema_file: # noqa: PLW2901
ver_schema = json.load(schema_file)
assert latest_schema == ver_schema

Expand Down
Loading