Skip to content
Open
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 @@ -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,
Expand Down
12 changes: 8 additions & 4 deletions tools/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
<!DOCTYPE HTML>
Expand All @@ -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"))
Expand All @@ -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__":
Expand Down
7 changes: 0 additions & 7 deletions tools/convert_docs.sh

This file was deleted.

Loading