Skip to content
Snippets Groups Projects

Update module to latest practices

Merged Vincent Hatakeyama requested to merge topic/15.0/update-to-latest-practices into branch/15.0
+ 17
14
@@ -34,7 +34,7 @@
"sphinx.ext.coverage",
"sphinx.ext.graphviz",
"sphinx.ext.viewcode",
"sphinxodoo.ext.autodoc",
"sphinxodooautodoc.ext.autodoc",
]
# Add any paths that contain templates here, relative to this directory.
@@ -145,7 +145,5 @@
intersphinx_mapping = {"https://docs.python.org/3/": None}
#
# odoo-sphinx-autodoc
#
# -- Options for sphinx-odoo-autodoc extension ----------------------------
@@ -151,5 +149,6 @@
# sphinxodoo_addons : List of addons name to load (if empty, no addon will be loaded)
# sphinxodooautodoc_addons : List of addons name to load (if empty, no addon will be
# loaded)
this_module = os.path.basename(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
@@ -153,10 +152,12 @@
this_module = os.path.basename(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
sphinxodoo_addons = [this_module]
# sphinxodoo_root_path : Path of the Odoo root directory
sphinxodoo_root_path = os.path.dirname(os.path.dirname(os.path.abspath(odoo.__file__)))
# sphinxodoo_addons_path : List of paths were Odoo addons to load are located
sphinxodooautodoc_addons = [this_module]
# sphinxodooautodoc_root_path : Path of the Odoo root directory
sphinxodooautodoc_root_path = os.path.dirname(
os.path.dirname(os.path.abspath(odoo.__file__))
)
# sphinxodooautodoc_addons_path : List of paths were Odoo addons to load are located
c = None
# find setup file of superproject, if any
directory = os.path.dirname(os.getenv("PWD"))
@@ -167,7 +168,7 @@
c.read(setup_path)
if c.has_section("odoo_scripts"):
# reload with odoo_scripts
c = Configuration(os.path.dirname(setup_path))
c = Configuration(directory)
else:
c = None
if not c:
@@ -176,9 +177,9 @@
else:
directory = None
sphinxodoo_addons_path = list()
sphinxodooautodoc_addons_path = []
if c:
addon_dirs = set(os.path.dirname(path) for path in c.modules)
for line in addon_dirs:
@@ -180,8 +181,8 @@
if c:
addon_dirs = set(os.path.dirname(path) for path in c.modules)
for line in addon_dirs:
sphinxodoo_addons_path.append(os.path.join(directory, line))
sphinxodooautodoc_addons_path.append(os.path.join(directory, line))
else:
# add this directory top dir
@@ -186,6 +187,8 @@
else:
# add this directory top dir
sphinxodoo_addons_path.append(os.path.dirname(os.path.dirname(os.getenv("PWD"))))
sphinxodooautodoc_addons_path.append(
os.path.dirname(os.path.dirname(os.getenv("PWD")))
)
other_addons = os.getenv("ODOO_ADDONS_PATH", default=None)
if other_addons:
for addon_path in other_addons.split(","):
@@ -189,4 +192,4 @@
other_addons = os.getenv("ODOO_ADDONS_PATH", default=None)
if other_addons:
for addon_path in other_addons.split(","):
sphinxodoo_addons_path.append(addon_path)
sphinxodooautodoc_addons_path.append(addon_path)
Loading