From 557b261e019642601cd9574842ffdff39ca7a0d2 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Mon, 9 May 2022 07:11:22 +0000 Subject: [PATCH] [FIX] conf: allow building the documentation with Python 3.6. Commit 3d358fdb introduced a new import of Odoo source files which complain about the minimal Python version if the hack added by 57e1e314 is not executed early enough. closes odoo/documentation#1949 Signed-off-by: Antoine Vandevenne (anv) --- conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index e639e14ce..60202d527 100644 --- a/conf.py +++ b/conf.py @@ -82,15 +82,15 @@ if not odoo_sources_dirs: {'dir_list': '\n'.join([f'\t- {d.resolve()}' for d in odoo_sources_candidate_dirs])}, ) else: + if (3, 6) < sys.version_info < (3, 7): + # Running odoo needs python 3.7 min but monkey patch version_info to be compatible with 3.6. + sys.version_info = (3, 7, 0) odoo_dir = odoo_sources_dirs[0].resolve() source_read_replace_vals['ODOO_RELPATH'] = '/../' + str(odoo_sources_dirs[0]) source_read_replace_vals['ODOO_ABSPATH'] = str(odoo_dir) sys.path.insert(0, str(odoo_dir)) import odoo.addons odoo.addons.__path__.append(str(odoo_dir) + '/addons') - if (3, 6) < sys.version_info < (3, 7): - # Running odoo needs python 3.7 min but monkey patch version_info to be compatible with 3.6 - sys.version_info = (3, 7, 0) from odoo import release as odoo_release # Don't collide with Sphinx's 'release' config option odoo_version = odoo_release.version.replace('~', '-') \ if 'alpha' not in odoo_release.version else 'master'