refactor(presets): extract compat overrides into dedicated module#76
Draft
refactor(presets): extract compat overrides into dedicated module#76
Conversation
0276f7a to
1d61201
Compare
…pandas) Odoo 12 ships old package versions that fail to build on modern systems: - reportlab==3.3.0: C extensions fail on modern compilers → pin 3.5.13 - psycopg2==2.7.3.1: uses Python 2's `basestring` → pin 2.8.3 - pandas==0.13.1: invalid PEP 440 metadata → pin >=1.0.0 All scoped to python_version < '3.8' (Odoo 12's runtime).
6b8962e to
0894a60
Compare
This was referenced Mar 25, 2026
Old pyopenssl+cryptography+urllib3 versions break on OpenSSL 3.x (Ubuntu 24.04+). They are a tightly-coupled trio and must be replaced together: - Odoo 12-14: pin pyopenssl==22.1.0 + cryptography==38.0.4 (OCA caps) - Odoo 15-17: pin pyopenssl>=24.0.0 + cryptography>=41.0.5 - Odoo 15: pin urllib3==1.26.14 (uses removed cryptography internal API) Moved from extra_requirement to extra_commands with odoo_version guards because python_version markers alone can't distinguish Odoo 14 vs 15 (both use Python 3.8).
Odoo 13 pins Pillow==5.4.1 but OCA's matplotlib==3.4.1 requires Pillow>=6.2.0. Ignore the old pin and replace with pillow>=6.2.0 for Python 3.7.
Add common OCA addon deps (pypdf, numpy-financial, bokeh, factur-x, schwifty, fsspec, easypost, etc.) to local, demo and ci presets.
pyldap is unmaintained and fails to build on OpenLDAP 2.5+ (libldap_r removed). Odoo 13+ already uses python-ldap. python-ldap 3.4.0 also hardcodes -lldap_r, so bump to 3.4.2 which supports OpenLDAP 2.5+. See: odoo/odoo#40069 See: odoo/odoo#109217
Split all_req_files into odoo_req_files and addons_req_files so base_pinned only includes Odoo's own pins, not addon dirs.
0894a60 to
1a3d5ba
Compare
trisdoan
added a commit
that referenced
this pull request
Apr 2, 2026
Add mode-based overrides to fix OpenSSL 3.x incompatibility (Ubuntu 24.04+) when creating venvs with OCA addons for Odoo 12-17. Conservative mode: exact pins per Odoo range - Odoo 12-14: pyopenssl==22.1.0 + cryptography==38.0.4 (OCA caps) - Odoo 15-17: pyopenssl>=24.0.0 + cryptography>=41.0.5 Modern mode: floor versions for all Odoo 12-17, resolver picks latest. Migrate urllib3 override from presets.toml to modes.toml with corrected scope (odoo_version >= 15.0 + python_version < 3.12). Ref: #76
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
When running odoo-venv across Odoo 12–19 with OCA repos, several Odoo requirement pins fail to build or cause runtime conflicts on modern systems (OpenSSL 3.x, Python 3.10+, modern compilers).
Problem packages
1.
pyldap==2.4.28(Odoo 12) /python-ldap==3.4.0(Odoo 13–17)pyldap is unmaintained and fails to build on OpenLDAP 2.5+ (libldap_r removed). python-ldap 3.4.0 also hardcodes
-lldap_r, so bump to 3.4.2.https://github.com/odoo/odoo/issues/40069https://github.com/odoo/odoo/pull/109217pyldap, ignorepython-ldap==3.4.0, addpython-ldap==3.4.22.
reportlab==3.3.0(Odoo 12)C extensions fail to build on modern systems — deprecated
Py_UNICODEC APIs.→ 3.5.13onpython_version < '3.8'3.
psycopg2==2.7.3.1(Odoo 12)Uses Python 2's
basestring, causesNameErroron any Python 3 import.https://github.com/odoo/odoo/issues/41313https://github.com/odoo/odoo/issues/42660→ 2.8.3onpython_version < '3.8'4.
pandas==0.13.1(Odoo 12, transitive viaaltair==4.0.1)Invalid PEP 440 metadata that modern
setuptools>=66strictly rejects.https://github.com/OCA/reporting-engine/issues/598→ >=1.0.0onpython_version < '3.8'5.
pyopenssl / cryptography / urllib3(Odoo 12–17)Old pyopenssl+cryptography+urllib3 versions break on OpenSSL 3.x (Ubuntu 24.04+). They are a tightly-coupled trio and must be replaced together.
https://github.com/odoo/odoo/issues/79697https://github.com/odoo/odoo/issues/99809https://github.com/odoo/odoo/pull/99829→ pyopenssl==22.1.0 + cryptography==38.0.4(constrained by OCA'spyOpenSSL<23)→ pyopenssl>=24.0.0 + cryptography>=41.0.5→ urllib3==1.26.14(uses removed cryptography internal API)Moved from
extra_requirementtoextra_commandswithodoo_versionguards becausepython_versionmarkers alone can't distinguish Odoo 14 vs 15 (both use Python 3.8).6.
Pillow==5.4.1(Odoo 13)Too old for
matplotlib>=3.4.1required by OCA modules (needs Pillow ≥ 6.2.0).https://github.com/odoo/odoo/issues/26175→ pillow>=6.2.0onpython_version < '3.8'7.
urllib3==1.26.5(Odoo 15–18)Too old for
sentry-sdkandgoogle-books-api-wrapperfrom OCA repos, and uses a cryptography internal API removed in 42+.https://github.com/odoo/odoo/issues/87444https://github.com/OCA/server-tools/issues/2927requests==2.21.0which capsurllib3<1.25— must be scoped to Odoo 15+ to avoid breaking Odoo 14.Other changes
presets.toml: OCA extra packages in[local],[demo], and[ci]Each package comes from a specific OCA module:
bokeh==2.3.1 / 2.4.2 / 3.1.1 / 3.4.1 / 3.6.3OCA/web→web_widget_bokeh_chartfactur-x<=3.2 / <=3.1 / (latest)OCA/account-invoicing→account_invoice_facturxfactur-x 4.xdropped Python 2 compatibility code used by older Odooschwifty==2024.4.0OCA/bank-statement-import→base_bank_from_iban(15.0+)fsspec>=2025.3.0OCA/storage→fs_attachment(17.0+)fsspecfor abstract filesystem accesseasypost==7.15.0OCA/delivery-carrier→delivery_easypost_oca(17.0+)main.py: track Odoo's requirements separately from addon dirs' requirementsBefore:
all_req_fileswas a flat list mixing Odoo's ownrequirements.txtwith addon dirs'requirements.txtfiles. This meant OCA addon mentions of packages (e.g., barecryptography) could pollutebase_pinnedand cause unintended auto-ignore interactions.After: split into
odoo_req_filesandaddons_req_files, combined only for installation.base_pinnednow only contains Odoo's own pins, so auto-ignore only triggers for packages Odoo actually pins.