chore(server): reformat code and improve mise tooling config

- Normalise le style (guillemets doubles, black/ruff)
- mise.toml : ajoute [tools], tâches dev/clean, port par défaut
- server.py : fallback PORT via variable d'environnement
This commit is contained in:
Guillaume DENIS 2026-07-04 18:12:34 +02:00 committed by TheHackdes
parent 3654cba41d
commit 05df4c0dd8
5 changed files with 245 additions and 172 deletions

View file

@ -1,5 +1,22 @@
# Portail Infra — mise config
# https://mise.jdx.dev
[tools]
python = "3.13"
uv = "latest"
[env]
# Port par défaut du serveur (surchargé par l'argument CLI de server.py)
PORT = "8000"
[tasks.run]
description = "Run server"
run = '''
uv run server.py
'''
description = "Lancer le serveur du portail (CMDB + Certificats + Switch)"
run = "uv run server.py {{arg(name='port', default='')}}"
[tasks.dev]
description = "Lancer le serveur en watch (redémarre à chaque modif .py)"
run = "uv run --with watchfiles watchfiles 'python server.py' server.py cmdb"
[tasks.clean]
description = "Nettoyer les caches Python"
run = "find . -type d -name __pycache__ -prune -exec rm -rf {} + ; rm -rf .ruff_cache"