[FIX] poetry update: skip requirements under doc and examples dirs
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
This commit is contained in:
parent
46acd94a29
commit
222613ee72
1 changed files with 14 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue