Skip to content

Commit ff33c5d

Browse files
committed
[FIX] Better handle cbor fix for Odoo 18 and newer python
1 parent 5584db5 commit ff33c5d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lib/install.bash

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,14 @@ function install_odoo_py_requirements_for_version {
563563
# Recent versions of setup tools do not support `use_2to3` flag,so,
564564
# we have to use another fork of suds to avoid errors during install
565565
echo "suds-py3";
566-
elif [[ "$dependency_stripped" =~ ^cbor2==5\.4\.2 ]] && exec_py -c "import sys; assert sys.version_info >= (3, 10);" > /dev/null 2>&1; then
567-
# cbor2==5.4.2 depends on pkg_resources that was removed from newer setuptools.
568-
# Odoo 18 specifies it as "cbor2==5.4.2 ; python_version < '3.12'" (with env marker),
569-
# so we must use regex match, not exact equality.
566+
elif [[ "$dependency_stripped" =~ ^cbor2==5\.4\.2 ]] && exec_py -c "import sys; assert (3, 10) <= sys.version_info < (3, 12);" > /dev/null 2>&1; then
567+
# cbor2==5.4.2 depends on pkg_resources that was removed from newer setuptools,
568+
# breaking installation on Python 3.10–3.11.
569+
# Odoo 18 specifies it as "cbor2==5.4.2 ; python_version < '3.12'" (with env
570+
# marker), so we use regex match. We only apply this on Python 3.10–3.11:
571+
# on Python 3.12+ the '< 3.12' marker already excludes this line, and the
572+
# separate "cbor2==5.6.2 ; python_version >= '3.12'" line handles that range.
573+
# Replacing without a marker on 3.12+ would conflict with that second line.
570574
# See: https://github.com/odoo/odoo/issues/248315
571575
echo "cbor2==5.4.6";
572576
else

0 commit comments

Comments
 (0)