Skip to content
Snippets Groups Projects
Commit 00140bb42720 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:ambulance: Odoo scripts version number fix for editable installs

Previously it would output 21.0.7.dev while after 21.0.7.
It now output 21.0.8.dev as expected.
parent 3a884602a664
No related branches found
No related tags found
1 merge request!206🚑 Odoo scripts version number fix for editable installs
......@@ -11,10 +11,10 @@
)
# This is maintained by bump2version.
__version__ = "21.0.7.dev"
__version__ = "21.0.7"
try:
# When using an editable install, the number would be off
distrib = distribution("odoo-scripts")
text = distrib.read_text("direct_url.json")
if text is not None:
json = loads(text)
......@@ -15,10 +15,13 @@
try:
# When using an editable install, the number would be off
distrib = distribution("odoo-scripts")
text = distrib.read_text("direct_url.json")
if text is not None:
json = loads(text)
if not json.get("dir_info", {}).get("editable", False):
if json.get("dir_info", {}).get("editable", False):
split = __version__.split(".")
__version__ = ".".join(split[:2] + [f"{int(split[2]) + 1}.dev"])
else:
__version__ = distrib.version
except PackageNotFoundError:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment