From b116b75a4c5ac10fbb439f464dc6f95034584844 Mon Sep 17 00:00:00 2001 From: Andrew Truong Date: Sat, 21 Jun 2025 12:13:55 +0100 Subject: [PATCH] chore: remove unused script --- .pre-commit-config.yaml | 2 +- tools/build_docs.py | 12 ++++++++---- tools/convert_docs.sh | 7 ------- 3 files changed, 9 insertions(+), 12 deletions(-) delete mode 100755 tools/convert_docs.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8f078d3..7bb7956a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: rev: "v1.15.0" hooks: - id: mypy - exclude: "test_decimal_constraints|examples/fields/test_example_2|examples/configuration|tools/" + exclude: "test_decimal_constraints|examples/fields/test_example_2" additional_dependencies: [ attrs>=22.2.0, diff --git a/tools/build_docs.py b/tools/build_docs.py index eba5a77e..608fbb78 100644 --- a/tools/build_docs.py +++ b/tools/build_docs.py @@ -5,6 +5,10 @@ import subprocess from contextlib import contextmanager from pathlib import Path +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from collections.abc import Generator REDIRECT_TEMPLATE = """ @@ -26,16 +30,16 @@ @contextmanager -def checkout(branch: str) -> None: +def checkout(branch: str) -> Generator[None, None, None]: subprocess.run(["git", "checkout", branch], check=True) # noqa: S603 S607 yield subprocess.run(["git", "checkout", "-"], check=True) # noqa: S603 S607 -def build(output_dir: str) -> None: +def build(output: str) -> None: subprocess.run(["make", "docs"], check=True) # noqa: S603 S607 - output_dir = Path(output_dir) + output_dir = Path(output) output_dir.mkdir() output_dir.joinpath(".nojekyll").touch(exist_ok=True) output_dir.joinpath("index.html").write_text(REDIRECT_TEMPLATE.format(target="latest")) @@ -46,7 +50,7 @@ def build(output_dir: str) -> None: def main() -> None: args = parser.parse_args() - build(output_dir=args.output) + build(output=args.output) if __name__ == "__main__": diff --git a/tools/convert_docs.sh b/tools/convert_docs.sh deleted file mode 100755 index 29a2d1e2..00000000 --- a/tools/convert_docs.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -CHANGELOG=docs/changelog.rst - -filename="${CHANGELOG%.*}" -echo "Converting $CHANGELOG to $filename.md" -pandoc --wrap=preserve $CHANGELOG -f rst -t markdown -o "$filename".md