about summary refs log tree commit diff
path: root/pkgs/development/python-modules/whool/setup-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/whool/setup-hook.sh')
-rw-r--r--pkgs/development/python-modules/whool/setup-hook.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/whool/setup-hook.sh b/pkgs/development/python-modules/whool/setup-hook.sh
new file mode 100644
index 000000000000..1c8ecdf2c663
--- /dev/null
+++ b/pkgs/development/python-modules/whool/setup-hook.sh
@@ -0,0 +1,16 @@
+# Avoid using git to auto-bump the addon version
+# DOCS https://github.com/sbidoul/whool/?tab=readme-ov-file#configuration
+whool-post-version-strategy-hook() {
+    # DOCS https://stackoverflow.com/a/13864829/1468388
+    if [ -z ${WHOOL_POST_VERSION_STRATEGY_OVERRIDE+x} ]; then
+        echo Setting WHOOL_POST_VERSION_STRATEGY_OVERRIDE to none
+        export WHOOL_POST_VERSION_STRATEGY_OVERRIDE=none
+    fi
+
+    # Make sure you can import the built addon
+    for manifest in $(find -L . -name __manifest__.py); do
+        export pythonImportsCheck="$pythonImportsCheck odoo.addons.$(basename $(dirname $(realpath $manifest)))"
+    done
+}
+
+preBuildHooks+=(whool-post-version-strategy-hook)