From a019183a01a48ba91b1629a5173e06591740a589 Mon Sep 17 00:00:00 2001 From: Bob Lin Date: Wed, 13 Dec 2023 07:34:50 +0800 Subject: [PATCH] create mypy cache dir if it doesn't exist (#14579) ### Description When running `make lint` multiple times, i can see the error `mkdir: .mypy_cache: File exists`. Use `mkdir -p` to solve this problem. Screenshot 2023-12-12 at 11 22 01 AM --- libs/community/Makefile | 2 +- libs/experimental/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/Makefile b/libs/community/Makefile index 203c028e3ee..900deed91ab 100644 --- a/libs/community/Makefile +++ b/libs/community/Makefile @@ -41,7 +41,7 @@ lint lint_diff lint_package lint_tests: poetry run ruff . [ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff [ "$(PYTHON_FILES)" = "" ] || poetry run ruff --select I $(PYTHON_FILES) - [ "$(PYTHON_FILES)" = "" ] || mkdir $(MYPY_CACHE) || poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) + [ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) || poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) format format_diff: poetry run ruff format $(PYTHON_FILES) diff --git a/libs/experimental/Makefile b/libs/experimental/Makefile index 623658354c2..7bc3abbf636 100644 --- a/libs/experimental/Makefile +++ b/libs/experimental/Makefile @@ -42,7 +42,7 @@ lint lint_diff lint_package lint_tests: poetry run ruff . poetry run ruff format $(PYTHON_FILES) --diff poetry run ruff --select I $(PYTHON_FILES) - mkdir $(MYPY_CACHE); poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) + mkdir -p $(MYPY_CACHE); poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) format format_diff: poetry run ruff format $(PYTHON_FILES)