From 35a68387ab35d014a39d9c67c9f40462987a25a8 Mon Sep 17 00:00:00 2001 From: Francwa Date: Mon, 22 Dec 2025 13:46:40 +0100 Subject: [PATCH] infra: use python version from pyproject.toml --- Makefile | 10 ++++++++-- brain/pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7f0b612..1097bf1 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ CORE_DIR = brain IMAGE_NAME = agent_media # renovate: datasource=docker depName=python -PYTHON_VERSION = 3.12.7 +PYTHON_VERSION = $(shell grep "python" $(CORE_DIR)/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 @@ -45,7 +45,7 @@ T = \033[36m R = \033[0m # --- TARGETS --- -.PHONY: add build build-test check-docker check-runner clean coverage down format help init-dotenv install install-hooks lint logs major minor patch prune ps restart run shell test up update _check_branch _ci-dump-config _ci-run-tests _push_tag +.PHONY: add build build-test check-docker check-runner clean coverage down format help init-dotenv install install-hooks lint logs major minor patch prune ps python-version restart run shell test up update _check_branch _ci-dump-config _ci-run-tests _push_tag # Catch-all for args %: @@ -207,6 +207,12 @@ ps: check-docker @echo "$(T)📋 Container status:$(R)" @$(COMPOSE_CMD) ps +python-version: + @echo "🔍 Reading pyproject.toml..." + @echo "✅ Python version : $(PYTHON_VERSION)" + @echo "ℹ️ Sera utilisé pour : FROM python:$(PYTHON_VERSION)-slim" + + restart: check-docker @echo "$(T)🔄 Restarting containers...$(R)" $(COMPOSE_CMD) restart diff --git a/brain/pyproject.toml b/brain/pyproject.toml index c078b0b..1a6af41 100644 --- a/brain/pyproject.toml +++ b/brain/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" package-mode = false [tool.poetry.dependencies] -python = "^3.12" +python = "==3.12.3" python-dotenv = "^1.0.0" requests = "^2.32.5" fastapi = "^0.121.1"