1- # Makefile pour le projet lifelib
2- # Automatisation de l'environnement de développement et des tâches courantes
1+ # Makefile for lifelib project
2+ # Automation of development environment and common tasks
33
44.PHONY : help venv install install-dev install-test clean clean-all test test-cov lint format check build dist
55
@@ -10,127 +10,127 @@ BIN := $(VENV)/bin
1010PYTHON_VENV := $(BIN ) /python
1111PIP := $(BIN ) /pip
1212
13- # Détection de l' OS pour activation
13+ # OS detection for activation
1414ifeq ($(OS ) ,Windows_NT)
1515 ACTIVATE := $(VENV)/Scripts/activate
1616else
1717 ACTIVATE := $(BIN)/activate
1818endif
1919
20- # Couleurs pour l'affichage
20+ # Colors for display
2121BLUE := \033[0;34m
2222GREEN := \033[0;32m
2323YELLOW := \033[0;33m
2424RED := \033[0;31m
2525NC := \033[0m # No Color
2626
27- # Cible par défaut
27+ # Default target
2828.DEFAULT_GOAL := help
2929
30- help : # # Afficher cette aide
30+ help : # # Display this help message
3131 @echo " $( BLUE) ═══════════════════════════════════════════════════════════$( NC) "
32- @echo " $( BLUE) Makefile pour lifelib - Gestion de l'environnement $( NC) "
32+ @echo " $( BLUE) Makefile for lifelib - Environment Management $( NC) "
3333 @echo " $( BLUE) ═══════════════════════════════════════════════════════════$( NC) "
3434 @echo " "
35- @echo " $( GREEN) Commandes disponibles :$( NC) "
35+ @echo " $( GREEN) Available commands :$( NC) "
3636 @echo " "
3737 @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf " $(YELLOW)%-20s$(NC) %s\n", $$1, $$2}'
3838 @echo " "
39- @echo " $( BLUE) Exemples d'utilisation :$( NC) "
40- @echo " make venv # Créer l'environnement virtuel "
41- @echo " make install-dev # Installer en mode développement "
42- @echo " make test # Lancer les tests"
43- @echo " make format # Formater le code"
39+ @echo " $( BLUE) Usage examples :$( NC) "
40+ @echo " make venv # Create virtual environment "
41+ @echo " make install-dev # Install in development mode "
42+ @echo " make test # Run tests"
43+ @echo " make format # Format code"
4444 @echo " "
4545
46- venv : # # Créer l'environnement virtuel Python
47- @echo " $( BLUE) Création de l'environnement virtuel ...$( NC) "
46+ venv : # # Create Python virtual environment
47+ @echo " $( BLUE) Creating virtual environment ...$( NC) "
4848 @if [ ! -d " $( VENV) " ]; then \
4949 $(PYTHON ) -m venv $(VENV ) ; \
50- echo " $( GREEN) ✓ Environnement virtuel créé dans $( VENV) $( NC) " ; \
50+ echo " $( GREEN) ✓ Virtual environment created in $( VENV) $( NC) " ; \
5151 else \
52- echo " $( YELLOW) ⚠ L'environnement virtuel existe déjà $( NC) " ; \
52+ echo " $( YELLOW) ⚠ Virtual environment already exists $( NC) " ; \
5353 fi
5454 @echo " "
55- @echo " $( GREEN) Pour activer l'environnement virtuel :$( NC) "
55+ @echo " $( GREEN) To activate the virtual environment :$( NC) "
5656 @echo " source $( ACTIVATE) "
5757
58- install : venv # # Installer le package en mode production
59- @echo " $( BLUE) Installation du package en mode production...$( NC) "
58+ install : venv # # Install package in production mode
59+ @echo " $( BLUE) Installing package in production mode ...$( NC) "
6060 @$(PIP ) install --upgrade pip setuptools wheel
6161 @$(PIP ) install -e .
62- @echo " $( GREEN) ✓ Installation terminée $( NC) "
62+ @echo " $( GREEN) ✓ Installation complete $( NC) "
6363
64- install-dev : venv # # Installer le package en mode développement (avec dépendances dev)
65- @echo " $( BLUE) Installation du package en mode développement ...$( NC) "
64+ install-dev : venv # # Install package in development mode (with dev dependencies )
65+ @echo " $( BLUE) Installing package in development mode ...$( NC) "
6666 @$(PIP ) install --upgrade pip setuptools wheel
6767 @$(PIP ) install -e " .[dev]"
68- @echo " $( GREEN) ✓ Installation développement terminée $( NC) "
68+ @echo " $( GREEN) ✓ Development installation complete $( NC) "
6969 @echo " "
70- @echo " $( GREEN) Dépendances installées :$( NC) "
70+ @echo " $( GREEN) Installed dependencies :$( NC) "
7171 @echo " - modelx (runtime)"
7272 @echo " - pytest, pytest-cov, pytest-xdist (tests)"
7373 @echo " - pandas, numpy, openpyxl (tests)"
7474 @echo " - flake8, black, isort (dev)"
7575
76- install-test : venv # # Installer le package en mode test uniquement
77- @echo " $( BLUE) Installation du package en mode test...$( NC) "
76+ install-test : venv # # Install package in test mode only
77+ @echo " $( BLUE) Installing package in test mode ...$( NC) "
7878 @$(PIP ) install --upgrade pip setuptools wheel
7979 @$(PIP ) install -e " .[test]"
80- @echo " $( GREEN) ✓ Installation test terminée $( NC) "
80+ @echo " $( GREEN) ✓ Test installation complete $( NC) "
8181
82- upgrade : venv # # Mettre à jour toutes les dépendances
83- @echo " $( BLUE) Mise à jour des dépendances ...$( NC) "
82+ upgrade : venv # # Upgrade all dependencies
83+ @echo " $( BLUE) Upgrading dependencies ...$( NC) "
8484 @$(PIP ) install --upgrade pip setuptools wheel
8585 @$(PIP ) install --upgrade -e " .[dev]"
86- @echo " $( GREEN) ✓ Dépendances mises à jour $( NC) "
86+ @echo " $( GREEN) ✓ Dependencies upgraded $( NC) "
8787
88- test : # # Lancer les tests avec pytest
89- @echo " $( BLUE) Lancement des tests...$( NC) "
88+ test : # # Run tests with pytest
89+ @echo " $( BLUE) Running tests...$( NC) "
9090 @$(BIN ) /pytest -v --cov=lifelib --cov-report=term-missing
91- @echo " $( GREEN) ✓ Tests terminés $( NC) "
91+ @echo " $( GREEN) ✓ Tests completed $( NC) "
9292
93- test-cov : # # Lancer les tests avec rapport de couverture HTML
94- @echo " $( BLUE) Lancement des tests avec rapport de couverture ...$( NC) "
93+ test-cov : # # Run tests with HTML coverage report
94+ @echo " $( BLUE) Running tests with coverage report ...$( NC) "
9595 @$(BIN ) /pytest --cov=lifelib --cov-report=html --cov-report=term --cov-report=xml
96- @echo " $( GREEN) ✓ Rapport de couverture généré dans htmlcov/index.html$( NC) "
96+ @echo " $( GREEN) ✓ Coverage report generated in htmlcov/index.html$( NC) "
9797
98- test-fast : # # Lancer les tests en parallèle (rapide )
99- @echo " $( BLUE) Lancement des tests en parallèle ...$( NC) "
98+ test-fast : # # Run tests in parallel (fast )
99+ @echo " $( BLUE) Running tests in parallel ...$( NC) "
100100 @$(BIN ) /pytest -n auto -v
101- @echo " $( GREEN) ✓ Tests terminés $( NC) "
101+ @echo " $( GREEN) ✓ Tests completed $( NC) "
102102
103- lint : # # Vérifier le code avec flake8
104- @echo " $( BLUE) Vérification du code avec flake8...$( NC) "
103+ lint : # # Check code with flake8
104+ @echo " $( BLUE) Checking code with flake8...$( NC) "
105105 @$(BIN ) /flake8 lifelib --count --select=E9,F63,F7,F82 --show-source --statistics
106106 @$(BIN ) /flake8 lifelib --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
107- @echo " $( GREEN) ✓ Vérification terminée $( NC) "
107+ @echo " $( GREEN) ✓ Check complete $( NC) "
108108
109- format : # # Formater le code avec black et isort
110- @echo " $( BLUE) Formatage du code avec black et isort...$( NC) "
109+ format : # # Format code with black and isort
110+ @echo " $( BLUE) Formatting code with black and isort...$( NC) "
111111 @$(BIN ) /black lifelib
112112 @$(BIN ) /isort lifelib
113- @echo " $( GREEN) ✓ Code formaté $( NC) "
113+ @echo " $( GREEN) ✓ Code formatted $( NC) "
114114
115- check : # # Vérifier le formatage sans modifier les fichiers
116- @echo " $( BLUE) Vérification du formatage ...$( NC) "
115+ check : # # Check formatting without modifying files
116+ @echo " $( BLUE) Checking formatting ...$( NC) "
117117 @$(BIN ) /black --check lifelib
118118 @$(BIN ) /isort --check-only lifelib
119- @echo " $( GREEN) ✓ Vérification terminée $( NC) "
119+ @echo " $( GREEN) ✓ Check complete $( NC) "
120120
121- check-all : lint check # # Vérifier le code et le formatage (lint + check)
122- @echo " $( GREEN) ✓ Toutes les vérifications sont terminées $( NC) "
121+ check-all : lint check # # Check code and formatting (lint + check)
122+ @echo " $( GREEN) ✓ All checks completed $( NC) "
123123
124- build : # # Construire le package (sdist et wheel)
125- @echo " $( BLUE) Construction du package...$( NC) "
124+ build : # # Build package (sdist and wheel)
125+ @echo " $( BLUE) Building package...$( NC) "
126126 @$(PYTHON_VENV ) -m pip install --upgrade build
127127 @$(PYTHON_VENV ) -m build
128- @echo " $( GREEN) ✓ Package construit dans dist/$( NC) "
128+ @echo " $( GREEN) ✓ Package built in dist/$( NC) "
129129
130- dist : clean build # # Nettoyer et construire le package pour distribution
130+ dist : clean build # # Clean and build package for distribution
131131
132- clean : # # Nettoyer les fichiers générés (cache, build, etc.)
133- @echo " $( BLUE) Nettoyage des fichiers générés ...$( NC) "
132+ clean : # # Clean generated files (cache, build, etc.)
133+ @echo " $( BLUE) Cleaning generated files ...$( NC) "
134134 @rm -rf build/
135135 @rm -rf dist/
136136 @rm -rf * .egg-info
@@ -143,60 +143,60 @@ clean: ## Nettoyer les fichiers générés (cache, build, etc.)
143143 @find . -type f -name " *.pyo" -delete
144144 @find . -type f -name " *.pyd" -delete
145145 @find . -type f -name " .coverage.*" -delete
146- @echo " $( GREEN) ✓ Nettoyage terminé $( NC) "
146+ @echo " $( GREEN) ✓ Cleaning complete $( NC) "
147147
148- clean-all : clean # # Nettoyer tout y compris l'environnement virtuel
149- @echo " $( BLUE) Suppression de l'environnement virtuel ...$( NC) "
148+ clean-all : clean # # Clean everything including virtual environment
149+ @echo " $( BLUE) Removing virtual environment ...$( NC) "
150150 @rm -rf $(VENV )
151- @echo " $( GREEN) ✓ Environnement virtuel supprimé $( NC) "
151+ @echo " $( GREEN) ✓ Virtual environment removed $( NC) "
152152
153- info : # # Afficher les informations sur l'environnement
153+ info : # # Display environment information
154154 @echo " $( BLUE) ═══════════════════════════════════════════════════════════$( NC) "
155- @echo " $( BLUE) Informations sur l'environnement $( NC) "
155+ @echo " $( BLUE) Environment Information $( NC) "
156156 @echo " $( BLUE) ═══════════════════════════════════════════════════════════$( NC) "
157157 @echo " "
158- @echo " $( GREEN) Python :$( NC) "
159- @which $(PYTHON ) && $(PYTHON ) --version || echo " Python non trouvé "
158+ @echo " $( GREEN) Python:$( NC) "
159+ @which $(PYTHON ) && $(PYTHON ) --version || echo " Python not found "
160160 @echo " "
161161 @if [ -d " $( VENV) " ]; then \
162- echo " $( GREEN) Environnement virtuel :$( NC) $( VENV) (actif )" ; \
163- echo " $( GREEN) Version Python :$( NC) " ; \
162+ echo " $( GREEN) Virtual environment :$( NC) $( VENV) (active )" ; \
163+ echo " $( GREEN) Python version :$( NC) " ; \
164164 $(PYTHON_VENV ) --version; \
165165 echo " " ; \
166- echo " $( GREEN) Packages installés :$( NC) " ; \
166+ echo " $( GREEN) Installed packages :$( NC) " ; \
167167 $(PIP ) list; \
168168 else \
169- echo " $( YELLOW) Environnement virtuel non créé $( NC) " ; \
170- echo " Lancez 'make venv' pour le créer " ; \
169+ echo " $( YELLOW) Virtual environment not created $( NC) " ; \
170+ echo " Run 'make venv' to create it " ; \
171171 fi
172172
173- shell : # # Ouvrir un shell dans l'environnement virtuel
174- @echo " $( BLUE) Ouverture d'un shell dans l'environnement virtuel ...$( NC) "
175- @echo " $( YELLOW) Pour quitter : tapez 'exit'$( NC) "
173+ shell : # # Open shell in virtual environment
174+ @echo " $( BLUE) Opening shell in virtual environment ...$( NC) "
175+ @echo " $( YELLOW) To exit: type 'exit'$( NC) "
176176 @. $(ACTIVATE ) && exec $(SHELL )
177177
178- tox : venv # # Lancer les tests avec tox (tous les environnements )
179- @echo " $( BLUE) Installation et lancement de tox...$( NC) "
178+ tox : venv # # Run tests with tox (all environments )
179+ @echo " $( BLUE) Installing and running tox...$( NC) "
180180 @$(PIP ) install tox
181181 @$(BIN ) /tox
182182
183- tox-lint : venv # # Lancer uniquement le linting avec tox
184- @echo " $( BLUE) Lancement du linting avec tox...$( NC) "
183+ tox-lint : venv # # Run linting only with tox
184+ @echo " $( BLUE) Running linting with tox...$( NC) "
185185 @$(PIP ) install tox
186186 @$(BIN ) /tox -e lint
187187
188- init : install-dev # # Initialiser complètement l'environnement de développement
188+ init : install-dev # # Fully initialize development environment
189189 @echo " "
190190 @echo " $( GREEN) ═══════════════════════════════════════════════════════════$( NC) "
191- @echo " $( GREEN) Environnement de développement prêt !$( NC) "
191+ @echo " $( GREEN) Development environment ready !$( NC) "
192192 @echo " $( GREEN) ═══════════════════════════════════════════════════════════$( NC) "
193193 @echo " "
194- @echo " $( YELLOW) Pour activer l'environnement virtuel :$( NC) "
194+ @echo " $( YELLOW) To activate the virtual environment :$( NC) "
195195 @echo " source $( ACTIVATE) "
196196 @echo " "
197- @echo " $( YELLOW) Commandes utiles :$( NC) "
198- @echo " make test # Lancer les tests"
199- @echo " make format # Formater le code"
200- @echo " make lint # Vérifier le code"
201- @echo " make help # Voir toutes les commandes "
197+ @echo " $( YELLOW) Useful commands :$( NC) "
198+ @echo " make test # Run tests"
199+ @echo " make format # Format code"
200+ @echo " make lint # Check code"
201+ @echo " make help # See all commands "
202202 @echo " "
0 commit comments