From 5bc398b5166e49147fa5fac41de0bc866a2159e0 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 23 Sep 2022 22:42:14 -0700 Subject: feat: initial commit --- make.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 make.py (limited to 'make.py') diff --git a/make.py b/make.py new file mode 100644 index 0000000..d37beb5 --- /dev/null +++ b/make.py @@ -0,0 +1,54 @@ +# This file is part of machinis . +# +# All rights reserved +# +# Copyright (C) 2022-2022 Fuwn +# SPDX-License-Identifier: UNLICENSED + +# type: ignore + +import subprocess +import sys + +import sane + +CC: str = {"win32": "python"}.get(sys.platform, "python3") +POETRY: str = {"win32": "poetry.bat"}.get(sys.platform, "poetry") + + +@sane.recipe() +def run(): + subprocess.run(f"{POETRY} run {CC} -m machinis") + + +@sane.recipe() +def fmt(): + subprocess.run(f"{POETRY} run black . -q") + + +@sane.recipe() +def sort(): + subprocess.run(f"{POETRY} run isort machinis make.py") + + +@sane.recipe() +def typing(): + subprocess.run(f"{POETRY} run mypy . --strict --no-error-summary") + + +@sane.recipe() +def spelling(): + subprocess.run(f"{POETRY} run codespell machinis make.py") + + +@sane.recipe() +def safety(): + subprocess.run(f"{POETRY} run safety check --bare") # --full-report + + +@sane.recipe(recipe_deps=["fmt", "sort", "typing", "spelling", "safety"]) +def check(): + pass + + +sane.sane_run(run) -- cgit v1.2.3