diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d044bb68..fa8418ec4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,12 +19,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.23.3 + rev: 0.26.3 hooks: - id: check-github-workflows - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: @@ -36,7 +36,7 @@ repos: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.281 + rev: v0.0.287 hooks: - id: ruff args: ["--fix"] diff --git a/nbconvert/exporters/pdf.py b/nbconvert/exporters/pdf.py index 9af669dc5..dcc05fc7d 100644 --- a/nbconvert/exporters/pdf.py +++ b/nbconvert/exporters/pdf.py @@ -115,9 +115,9 @@ def run_command( # noqa if cmd is None: link = "https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex" msg = ( - "{formatter} not found on PATH, if you have not installed " - "{formatter} you may need to do so. Find further instructions " - "at {link}.".format(formatter=command_list[0], link=link) + f"{command_list[0]} not found on PATH, if you have not installed " + f"{command_list[0]} you may need to do so. Find further instructions " + f"at {link}." ) raise OSError(msg) diff --git a/nbconvert/filters/datatypefilter.py b/nbconvert/filters/datatypefilter.py index 3676c9210..137a5a7d9 100644 --- a/nbconvert/filters/datatypefilter.py +++ b/nbconvert/filters/datatypefilter.py @@ -39,8 +39,7 @@ def __call__(self, output): if fmt in output: return [fmt] warn( - "Your element with mimetype(s) {mimetypes}" - " is not able to be represented.".format(mimetypes=output.keys()), + f"Your element with mimetype(s) {output.keys()} is not able to be represented.", stacklevel=2, ) diff --git a/nbconvert/filters/widgetsdatatypefilter.py b/nbconvert/filters/widgetsdatatypefilter.py index d81f9f36f..01da1888a 100644 --- a/nbconvert/filters/widgetsdatatypefilter.py +++ b/nbconvert/filters/widgetsdatatypefilter.py @@ -70,8 +70,7 @@ def __call__(self, output): return [fmt] warn( - "Your element with mimetype(s) {mimetypes}" - " is not able to be represented.".format(mimetypes=output.keys()), + f"Your element with mimetype(s) {output.keys()} is not able to be represented.", stacklevel=2, ) diff --git a/nbconvert/preprocessors/extractoutput.py b/nbconvert/preprocessors/extractoutput.py index 98083c28d..4a9cf6f25 100644 --- a/nbconvert/preprocessors/extractoutput.py +++ b/nbconvert/preprocessors/extractoutput.py @@ -137,10 +137,10 @@ def preprocess_cell(self, cell, resources, cell_index): # noqa "with them. Nbconvert saves these outputs to " "external files using this filename metadata. " "Filenames need to be unique across the notebook, " - "or images will be overwritten. The filename {} is " + f"or images will be overwritten. The filename {filename} is " "associated with more than one output. The second " "output associated with this filename is in cell " - "{}.".format(filename, cell_index) + f"{cell_index}." ) raise ValueError(msg) # In the resources, make the figure available via diff --git a/nbconvert/tests/test_nbconvertapp.py b/nbconvert/tests/test_nbconvertapp.py index 2220c8bb3..8d83caa9b 100644 --- a/nbconvert/tests/test_nbconvertapp.py +++ b/nbconvert/tests/test_nbconvertapp.py @@ -527,7 +527,7 @@ def fig_exists(path): path = os.path.join(output_dir.name, "files") self.nbconvert( "--log-level 0 notebook4_jpeg.ipynb --to rst " - "--NbConvertApp.output_files_dir={}".format(path) + f"--NbConvertApp.output_files_dir={path}" ) assert fig_exists(path) output_dir.cleanup() diff --git a/pyproject.toml b/pyproject.toml index d20ab9cf6..9d4e556bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,7 +130,7 @@ dependencies = [ "black[jupyter]==23.3.0", "mdformat>0.7", "mdformat-gfm>=0.3.5", - "ruff==0.0.281" + "ruff==0.0.287" ] detached = true [tool.hatch.envs.lint.scripts]