diff --git a/.rhiza/make.d/03-marimo.mk b/.rhiza/make.d/03-marimo.mk index 25975735..6bce2f07 100644 --- a/.rhiza/make.d/03-marimo.mk +++ b/.rhiza/make.d/03-marimo.mk @@ -1,6 +1,12 @@ ## Makefile.marimo - Marimo notebook targets # This file is included by the main Makefile +# Add MARIMO_FOLDER to deptry configuration if it exists +ifneq ($(wildcard $(MARIMO_FOLDER)),) +DEPTRY_FOLDERS += $(MARIMO_FOLDER) +DEPTRY_IGNORE += --ignore DEP004 +endif + # Declare phony targets (they don't produce files) .PHONY: marimo-validate marimo marimushka diff --git a/.rhiza/make.d/src.mk b/.rhiza/make.d/src.mk new file mode 100644 index 00000000..93f9e752 --- /dev/null +++ b/.rhiza/make.d/src.mk @@ -0,0 +1,15 @@ +## Makefile.src - Source folder configuration +# This file is included by the main Makefile + +# Add SOURCE_FOLDER to deptry configuration if it exists +ifneq ($(wildcard $(SOURCE_FOLDER)),) +DEPTRY_FOLDERS += $(SOURCE_FOLDER) +endif + +##@ Quality and Formatting +deptry: install-uv ## Run deptry + @printf "${BLUE}[INFO] DEPTRY_FOLDERS: ${DEPTRY_FOLDERS}${RESET}\n" + @if [ -n "$(strip ${DEPTRY_FOLDERS})" ]; then \ + printf "${BLUE}[INFO] Running: $(UVX_BIN) -p ${PYTHON_VERSION} deptry ${DEPTRY_FOLDERS} ${DEPTRY_IGNORE}${RESET}\n"; \ + $(UVX_BIN) -p ${PYTHON_VERSION} deptry ${DEPTRY_FOLDERS} ${DEPTRY_IGNORE}; \ + fi diff --git a/.rhiza/rhiza.mk b/.rhiza/rhiza.mk index 12485d88..415b130e 100644 --- a/.rhiza/rhiza.mk +++ b/.rhiza/rhiza.mk @@ -230,19 +230,6 @@ clean: ## Clean project artifacts and stale local branches @git branch -vv | awk '/: gone]/{print $$1}' | xargs -r git branch -D ##@ Quality and Formatting -deptry: install-uv ## Run deptry - @if [ -d ${SOURCE_FOLDER} ]; then \ - $(UVX_BIN) -p ${PYTHON_VERSION} deptry ${SOURCE_FOLDER}; \ - fi - - @if [ -d ${MARIMO_FOLDER} ]; then \ - if [ -d ${SOURCE_FOLDER} ]; then \ - $(UVX_BIN) -p ${PYTHON_VERSION} deptry ${MARIMO_FOLDER} ${SOURCE_FOLDER} --ignore DEP004; \ - else \ - $(UVX_BIN) -p ${PYTHON_VERSION} deptry ${MARIMO_FOLDER} --ignore DEP004; \ - fi \ - fi - fmt: install-uv ## check the pre-commit hooks and the linting @${UVX_BIN} -p ${PYTHON_VERSION} pre-commit run --all-files diff --git a/tests/test_rhiza/test_makefile.py b/tests/test_rhiza/test_makefile.py index e782ca45..0c408242 100644 --- a/tests/test_rhiza/test_makefile.py +++ b/tests/test_rhiza/test_makefile.py @@ -32,6 +32,7 @@ ".rhiza/make.d/03-marimo.mk", ".rhiza/make.d/04-presentation.mk", ".rhiza/make.d/05-github.mk", + ".rhiza/make.d/src.mk", ]