infra: removed CORE_DIR variable from Makefile (not relevant anymore)
This commit is contained in:
25
Makefile
25
Makefile
@@ -3,10 +3,9 @@
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
# --- SETTINGS ---
|
||||
CORE_DIR = alfred
|
||||
IMAGE_NAME = alfred_media_organizer
|
||||
# renovate: datasource=docker depName=python
|
||||
PYTHON_VERSION = $(shell grep "python" $(CORE_DIR)/pyproject.toml | head -n 1 | sed -E 's/.*[=<>^~"]+ *([0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/')
|
||||
PYTHON_VERSION = $(shell grep "python" pyproject.toml | head -n 1 | sed -E 's/.*[=<>^~"]+ *([0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/')
|
||||
PYTHON_VERSION_SHORT = $(shell echo $(PYTHON_VERSION) | cut -d. -f1,2)
|
||||
# Change to 'uv' when ready.
|
||||
RUNNER ?= poetry
|
||||
@@ -23,20 +22,19 @@ INSTALL_CMD = $(if $(filter uv,$(RUNNER)),sync,install)
|
||||
|
||||
# --- MACROS ---
|
||||
ARGS = $(filter-out $@,$(MAKECMDGOALS))
|
||||
BUMP_CMD = cd $(CORE_DIR) && $(RUNNER) run bump-my-version bump
|
||||
BUMP_CMD = $(RUNNER) run bump-my-version bump
|
||||
COMPOSE_CMD = docker-compose
|
||||
DOCKER_CMD = docker build \
|
||||
--build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
|
||||
--build-arg PYTHON_VERSION_SHORT=$(PYTHON_VERSION_SHORT) \
|
||||
--build-arg RUNNER=$(RUNNER) \
|
||||
-f $(CORE_DIR)/Dockerfile \
|
||||
-t $(IMAGE_NAME):latest .
|
||||
|
||||
RUNNER_ADD = cd $(CORE_DIR) && $(RUNNER) add
|
||||
RUNNER_HOOKS = cd $(CORE_DIR) && $(RUNNER) run pre-commit install -c ../.pre-commit-config.yaml
|
||||
RUNNER_INSTALL = cd $(CORE_DIR) && $(RUNNER) $(INSTALL_CMD)
|
||||
RUNNER_RUN = cd $(CORE_DIR) && $(RUNNER) run
|
||||
RUNNER_UPDATE = cd $(CORE_DIR) && $(RUNNER) update
|
||||
RUNNER_ADD = $(RUNNER) add
|
||||
RUNNER_HOOKS = $(RUNNER) run pre-commit install -c ../.pre-commit-config.yaml
|
||||
RUNNER_INSTALL = $(RUNNER) $(INSTALL_CMD)
|
||||
RUNNER_RUN = $(RUNNER) run
|
||||
RUNNER_UPDATE = $(RUNNER) update
|
||||
|
||||
# --- STYLES ---
|
||||
B = \033[1m
|
||||
@@ -66,7 +64,6 @@ build-test: check-docker
|
||||
--build-arg RUNNER=$(RUNNER) \
|
||||
--build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
|
||||
--build-arg PYTHON_VERSION_SHORT=$(PYTHON_VERSION_SHORT) \
|
||||
-f $(CORE_DIR)/Dockerfile \
|
||||
--target test \
|
||||
-t $(IMAGE_NAME):test .
|
||||
@echo "✅ Test image $(IMAGE_NAME):test ready."
|
||||
@@ -80,10 +77,10 @@ check-runner:
|
||||
|
||||
clean:
|
||||
@echo "$(T)🧹 Cleaning caches...$(R)"
|
||||
cd $(CORE_DIR) && rm -rf .ruff_cache __pycache__ .pytest_cache
|
||||
find $(CORE_DIR) -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
||||
find $(CORE_DIR) -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
|
||||
find $(CORE_DIR) -type f -name "*.pyc" -delete 2>/dev/null || true
|
||||
rm -rf .ruff_cache __pycache__ .pytest_cache
|
||||
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
||||
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
|
||||
find . -type f -name "*.pyc" -delete 2>/dev/null || true
|
||||
@echo "✅ Caches cleaned."
|
||||
|
||||
coverage: check-runner
|
||||
|
||||
Reference in New Issue
Block a user