From 222613ee72c8ce9e1b59a6852b938ce2a53ecb3f Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 25 Sep 2026 04:17:56 -0400 Subject: [PATCH] [FIX] poetry update: skip requirements under doc and examples dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit poetry_update.py read every requirements.txt of the addon repositories, illustrations included: an example file declaring a loose ">=" moved a dependency for the whole environment, past the pin Odoo sets. A path with a directory named doc, docs, example or examples, compared by exact name, is now skipped for requirements and manifests alike; the ERPLibre requirements file is still added without filtering. Checked on a tree with the extra repositories: 70 requirements and 4016 manifests found, the one example file skipped, no manifest lost. --- FR --- [FIX] poetry update : ignorer les requirements sous doc et examples poetry_update.py lisait tout requirements.txt des dépôts d'addons, illustrations comprises : un fichier d'exemple déclarant un « >= » lâche déplaçait une dépendance pour tout l'environnement, par-delà l'épingle d'Odoo. Un chemin dont un répertoire s'appelle doc, docs, example ou examples, comparé au nom exact, est désormais écarté, requirements comme manifestes ; le requirements d'ERPLibre reste ajouté sans filtre. Vérifié sur une arborescence avec les dépôts extra : 70 requirements et 4016 manifestes trouvés, le seul fichier d'exemple écarté, aucun manifeste perdu. Assisted-by: Claude Opus 5.5 --- script/poetry/poetry_update.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/script/poetry/poetry_update.py b/script/poetry/poetry_update.py index 7354531..f9e2d4b 100755 --- a/script/poetry/poetry_update.py +++ b/script/poetry/poetry_update.py @@ -113,12 +113,24 @@ def get_lst_manifest_py(config, ignore_dir_startswith: list = None): ) +# A file under one of these directories documents or illustrates, it does not +# declare what an addon needs: an example requirements.txt with a loose +# ">=" would otherwise override a pin for the whole environment. +IGNORED_DIR_NAMES = {"doc", "docs", "example", "examples"} + + def get_file_from_glob( config, glob_txt, ignore_dir_startswith: list = None, force_add_item: list = None, ): + """Files matching glob_txt under the Odoo tree of the active version. + + A path is skipped when a directory of it is named in IGNORED_DIR_NAMES, + compared by exact name, or when it starts with one of + ignore_dir_startswith. force_add_item is appended without filtering. + """ lst_v = [] # TODO take all groups odoo##.# from manifest, will create a dependency # Hardcode logic from manifest @@ -131,6 +143,8 @@ def get_file_from_glob( a_dirname = os.path.dirname(a) if a_dirname.startswith(".repo/") or a_dirname.startswith(".venv"): continue + if IGNORED_DIR_NAMES.intersection(Path(a_dirname).parts): + continue if ignore_dir_startswith: ignore_it = False for item_ignore_dir in ignore_dir_startswith: