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

[pre-commit.ci] pre-commit autoupdate #48

Merged
merged 5 commits into from
Aug 16, 2023
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.282
rev: v0.0.284
hooks:
- id: ruff
args:
Expand Down
6 changes: 3 additions & 3 deletions gepetuto/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def generate(tp_id: List[int], **kwargs):
"""Parse python scripts to generate snippets."""
LOG.info("generating snippets from tutorial sources.")
for n in tp_id:
LOG.debug(f"Looking for tp {n}")
LOG.debug("Looking for tp %s", n)
generate_from_id(n)


Expand All @@ -26,7 +26,7 @@ def generate_from_id(tp_id: int):

def generate_ipynb(ipynb, folder, force_load=False): # noqa: C901
"""Cut python files in bits loadable by ipython."""
LOG.info(f"processing '{ipynb}' with scripts in '{folder}'")
LOG.info("processing '%s' with scripts in '%s'", ipynb, folder)
with ipynb.open() as f:
data = json.load(f)
for cell in data["cells"]:
Expand All @@ -38,7 +38,7 @@ def generate_ipynb(ipynb, folder, force_load=False): # noqa: C901
for generated_file in generated.glob("*"):
Path.unlink(generated_file)
for filename in folder.glob("*.py"):
LOG.info(f" processing '{filename}'")
LOG.info(" processing '%s'", filename)
content = []
dest = None
with filename.open() as f_in:
Expand Down
2 changes: 1 addition & 1 deletion gepetuto/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def lint(files, **kwargs):

def lint_file(file, check):
"""Lint python script."""
LOG.debug(f"Checking {file}")
LOG.debug("Checking %s", file)
if check:
check_call(["isort", file, "--check"])
check_call(["black", file, "--check"])
Expand Down
2 changes: 1 addition & 1 deletion gepetuto/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def retrieve_python_interpreter():
check_call(["python", "--version"])
return "python"
except FileNotFoundError:
LOG.warn(
LOG.warning(
"Didn't found 'python3' or 'python' executable, using ",
sys.executable,
)
Expand Down
4 changes: 2 additions & 2 deletions gepetuto/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test(files, **kwargs):
LOG.info("testing tutorial sources.")
for tp_files in files.values():
for tp_file in tp_files:
LOG.debug(f"Checking {tp_file}")
LOG.debug("Checking %s", tp_file)
check_call([python_interpreter, tp_file])
ipynbs = get_ipynbs(files)
for tp_ipynbs in ipynbs.values():
Expand Down Expand Up @@ -46,6 +46,6 @@ def check_ipynb(ipynb, python_interpreter):
generate_ipynb(ipynb, tp_path, True)
check_call(["jupyter", "nbconvert", "--to", "script", f"{ipynb}"])
converted_ipynb = next(Path().glob(f"{prefix}-*.py"))
LOG.debug(f"Checking temporary file {converted_ipynb}")
LOG.debug("Checking temporary file %s", converted_ipynb)
check_call([python_interpreter, converted_ipynb])
Path.unlink(converted_ipynb)