diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4e7f89..7088015 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.23.2 + rev: 0.23.3 hooks: - id: check-github-workflows @@ -30,12 +30,12 @@ repos: - id: mdformat - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.276 + rev: v0.0.281 hooks: - id: ruff args: ["--fix"] diff --git a/nbformat/validator.py b/nbformat/validator.py index f72fbbc..32ba948 100644 --- a/nbformat/validator.py +++ b/nbformat/validator.py @@ -474,10 +474,9 @@ def validate( # noqa version = nbdict_version if version_minor is None: version_minor = nbdict_version_minor - else: - # if ref is specified, and we don't have a version number, assume we're validating against 1.0 - if version is None: # noqa - version, version_minor = 1, 0 + # if ref is specified, and we don't have a version number, assume we're validating against 1.0 + elif version is None: + version, version_minor = 1, 0 if ref is None: assert isinstance(version, int) # noqa diff --git a/pyproject.toml b/pyproject.toml index ac5c014..5de7a3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,7 @@ dependencies = ["mypy>=0.990"] test = "mypy --install-types --non-interactive {args:nbformat tests}" [tool.hatch.envs.lint] -dependencies = ["black[jupyter]==23.3.0", "mdformat>0.7", "ruff==0.0.276"] +dependencies = ["black[jupyter]==23.3.0", "mdformat>0.7", "ruff==0.0.281"] detached = true [tool.hatch.envs.lint.scripts] style = [ diff --git a/tests/v4/test_json.py b/tests/v4/test_json.py index 21c7f9e..4aed699 100644 --- a/tests/v4/test_json.py +++ b/tests/v4/test_json.py @@ -115,9 +115,7 @@ def test_base_version_matches_latest(self): with open( os.path.join( BASE_PATH, - "nbformat.v{major}.{minor}.schema.json".format( - major=nbformat, minor=nbformat_minor - ), + f"nbformat.v{nbformat}.{nbformat_minor}.schema.json", ), encoding='utf-8', ) as schema_file: # noqa