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