Files
team-tryouts/pyproject.toml
T
GGThedandClaude Opus 5 2f40290f00 fix(deps): nommer le pilote PostgreSQL, sinon rien ne demarre
QUA-001, volet dialecte.

`postgresql://` ne veut pas dire "le pilote installe" : SQLAlchemy y lit
psycopg2 et importe ce module a la creation du moteur. requirements.txt
epingle psycopg 3 (`psycopg[binary]`) et pas psycopg2. Une installation
propre demarree sur cette URL leve donc

  ModuleNotFoundError: No module named 'psycopg2'

avant la premiere requete. Verifie dans le .venv du depot, et c est
exactement la forme que Render distribue -- celle que docs/deployment.md et
docs/database-restore.md donnaient en exemple.

normalise_database_url() nomme le pilote quand l URL n en nomme pas.
`postgres://` (alias hérite, abandonne par SQLAlchemy en 1.4) est traite de
meme. Une URL qui nomme deja son pilote est laissee telle quelle, y compris
`postgresql+psycopg2://` : un environnement qui a psycopg2 garde le choix.

La normalisation a lieu apres l application de la configuration passee en
argument, pour couvrir aussi les appels de test. backup.py n avait pas
besoin d etre touche : il retirait deja le suffixe +pilote.

Documentation alignee sur les trois fichiers qui donnaient l exemple, dont
docs/deployment.md qui proposait sqlite:/// pour DATABASE_URL alors que
create_app refuse de demarrer sans PostgreSQL.

Reste de QUA-001, dit franchement
  - les trois paquets parasites (dotenv, login, discord) ne sont plus dans
    requirements.txt : deja retires. psycopg est deja epingle.
  - la consolidation vers des groupes de dependances n est PAS faite. Le
    deploiement est un miroir de fichiers lftp sans etape de construction ;
    les groupes PEP 735 demandent pip >= 25.1 sur une machine dont on ne
    peut pas verifier la version d ici. A revoir avec OPS-011.

14 tests, dont trois qui prouvent que l echec est reel et non theorique.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 15:50:35 -04:00

51 lines
2.0 KiB
TOML

# Tooling configuration.
#
# Deliberately limited to tool settings: the project is run from wsgi.py,
# not installed as a distribution, so there is no [project] table.
#
# QUA-001 asked for requirements.txt / requirements-dev.txt to be folded
# into dependency groups here. Not done, on purpose. Deployment is an
# lftp file mirror with no build step: the server runs whatever
# `pip install -r requirements.txt` gives it, and PEP 735 groups need
# pip >= 25.1 on a machine whose pip version cannot be checked from here.
# Trading a working install path for a tidier declaration is not a trade
# worth making blind. The parts of QUA-001 that were real defects — the
# psycopg dialect and the parasitic packages — are fixed; revisit the
# consolidation when the deployment gains a build step (OPS-011).
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
addopts = "-q --strict-markers --strict-config"
filterwarnings = [
"default",
# discord.py imports audioop, removed from the stdlib in 3.13.
"ignore:'audioop' is deprecated:DeprecationWarning",
# Every model uses datetime.utcnow as a column default. Tracked as
# DB-009; the warning would otherwise drown the run.
"ignore:datetime.datetime.utcnow:DeprecationWarning",
]
[tool.ruff]
line-length = 100
target-version = "py312"
exclude = [".venv", "venv", "migrations", "docs"]
[tool.ruff.lint]
# Starting from ruff's default rule set (pyflakes + a slice of pycodestyle).
# Widening it — bugbear, isort, pyupgrade — is deliberately deferred until
# the codebase has been formatted once, so that the first enforcement is
# about real defects rather than churn. Tracked as QUA-002.
select = ["E4", "E7", "E9", "F"]
[tool.ruff.lint.per-file-ignores]
# Intentional re-export facade: `from app.models import User, Tryout, ...`
# is the documented entry point, and importing the modules is what
# registers every model with SQLAlchemy.
"app/models/__init__.py" = ["F401"]
"app/models/user_model/__init__.py" = ["F401"]
"tests/conftest.py" = ["E402"]
[tool.ruff.format]
quote-style = "preserve"