[FIX] version : nommer le Python d'Odoo et celui de l'outillage
« make version » lit .python-odoo-version et l'affichait sous le libellé nu « Python version ». Tant que les deux venvs partageaient leur interpréteur, le libellé suffisait ; depuis qu'ils divergent, il laisse croire que le dépôt n'a qu'une version de Python, et le chiffre affiché n'est pas celui du venv dans lequel l'utilisateur travaille. Les deux sont désormais nommées, celle d'Odoo comme celle de l'outillage. Seule la sortie change : cette valeur ne participe à aucun identifiant, et l'absence du fichier reste sans conséquence. Vérifié : les deux versions s'affichent, puis la conclusion reste la même. --- EN --- "make version" reads .python-odoo-version and printed it under the bare label "Python version". While both venvs shared their interpreter the label was enough; now that they diverge, it suggests the repository has a single Python version, and the figure shown is not that of the venv the user works in. Both are now named, Odoo's and the tooling's. Only the output changes: this value takes part in no identifier, and a missing file stays without consequence. Checked: both versions print, then the conclusion stays the same. Assisted-by: Claude Opus 5
This commit is contained in:
parent
cb1ff8dcb2
commit
d1e1c2a812
1 changed files with 29 additions and 15 deletions
|
|
@ -53,6 +53,10 @@ INSTALLED_ODOO_VERSION_FILE = ".repo/installed_odoo_version.txt"
|
|||
VERSION_ERPLIBRE_FILE = os.path.join(".erplibre-version")
|
||||
VERSION_ODOO_FILE = os.path.join(".odoo-version")
|
||||
VERSION_POETRY_FILE = os.path.join(".poetry-version")
|
||||
# Le Python de l'OUTILLAGE, distinct de celui d'Odoo depuis que .venv.erplibre
|
||||
# ne partage plus son interpréteur : il ne participe à aucun identifiant de
|
||||
# version, il n'est là que pour être dit.
|
||||
VERSION_PYTHON_ERPLIBRE_FILE = os.path.join("conf", "python-erplibre-version")
|
||||
ADDONS_PATH = os.path.join("addons")
|
||||
MOBILE_PATH = os.path.join("mobile", "erplibre_home_mobile")
|
||||
VENV_TEMPLATE_FILE = ".venv.%s"
|
||||
|
|
@ -232,7 +236,14 @@ class Update:
|
|||
self.mobile_active = os.path.isdir(MOBILE_PATH)
|
||||
|
||||
# Show actual version
|
||||
_logger.info(f"Python version: {self.python_version}")
|
||||
# « d'Odoo » nommé : le venv d'outillage tourne sur une AUTRE version,
|
||||
# et un libellé nu laissait croire que le dépôt n'en a qu'une.
|
||||
_logger.info(f"Python version (Odoo): {self.python_version}")
|
||||
if os.path.exists(VERSION_PYTHON_ERPLIBRE_FILE):
|
||||
with open(VERSION_PYTHON_ERPLIBRE_FILE) as txt:
|
||||
_logger.info(
|
||||
f"Python version (outillage): {txt.read().strip()}"
|
||||
)
|
||||
_logger.info(f"Odoo version: {self.odoo_version}")
|
||||
_logger.info(f"Poetry version: {poetry_version}")
|
||||
_logger.info(
|
||||
|
|
@ -482,7 +493,9 @@ class Update:
|
|||
)
|
||||
else:
|
||||
with_extra = get_version_extra(self.new_version_odoo)
|
||||
manifest_script = "./script/manifest/update_manifest_local_dev.sh"
|
||||
manifest_script = (
|
||||
"./script/manifest/update_manifest_local_dev.sh"
|
||||
)
|
||||
if with_extra:
|
||||
manifest_script += " --with_extra"
|
||||
status = os.system(manifest_script)
|
||||
|
|
@ -603,15 +616,16 @@ class Update:
|
|||
existing = [p.strip() for p in value.split(",") if p.strip()]
|
||||
missing = [p for p in extra_paths if p not in existing]
|
||||
if missing:
|
||||
lines[i] = "addons_path = " + ",".join(existing + missing) + "\n"
|
||||
lines[i] = (
|
||||
"addons_path = " + ",".join(existing + missing) + "\n"
|
||||
)
|
||||
changed = True
|
||||
break
|
||||
if changed:
|
||||
with open(config_path, "w", encoding="utf-8") as f:
|
||||
f.writelines(lines)
|
||||
_logger.info(
|
||||
"Added extra addons to config.conf: "
|
||||
+ ", ".join(extra_paths)
|
||||
"Added extra addons to config.conf: " + ", ".join(extra_paths)
|
||||
)
|
||||
else:
|
||||
_logger.info("Extra addons already present in config.conf.")
|
||||
|
|
@ -857,17 +871,17 @@ def main():
|
|||
update.add_extra_to_config_conf()
|
||||
|
||||
return exit_code
|
||||
# TODO ignore this if installation fail
|
||||
# TODO ignore this if installation fail
|
||||
|
||||
# TODO this cause an error at first execution, need to source ./.venv.erplibre/bin/activate and rerun
|
||||
# subprocess.run(['source', './.venv.erplibre/bin/activate'], shell=True)
|
||||
# subprocess.run(['make', 'config_gen_all'])
|
||||
# status = os.system(f"make config_gen_all")
|
||||
#
|
||||
# if not status:
|
||||
# print("Please run:")
|
||||
# print("source ./.venv.erplibre/bin/activate")
|
||||
# print("make config_gen_all")
|
||||
# TODO this cause an error at first execution, need to source ./.venv.erplibre/bin/activate and rerun
|
||||
# subprocess.run(['source', './.venv.erplibre/bin/activate'], shell=True)
|
||||
# subprocess.run(['make', 'config_gen_all'])
|
||||
# status = os.system(f"make config_gen_all")
|
||||
#
|
||||
# if not status:
|
||||
# print("Please run:")
|
||||
# print("source ./.venv.erplibre/bin/activate")
|
||||
# print("make config_gen_all")
|
||||
|
||||
|
||||
def die(cond, message, code=1):
|
||||
|
|
|
|||
Loading…
Reference in a new issue