Files
odoo_source/odoo/addons/__init__.py
T
Stéphane Bidoul (ACSONE) 8bf06adc8d [FIX] namespace packages: move from pkg_resources-style to pkg_util
Deprecates the previous pkg_resources-style packages. Our use was
not entirely spec compliant, and it broke with setuptools 31.
More information in https://github.com/odoo/odoo/pull/15718

Instead, use the pkgutil-style namespace packages.
This is spec compliant as long as all other distributions providing
odoo.addons use PEP 420 namespace packages (i.e. no __init__.py).
So this mechanism fully works on Python 3 only, but does not break
anything on Python 2.

See also:
https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages

Closes #19517
Fixes #15718
2017-09-18 16:05:31 +02:00

21 lines
752 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" Addons module.
This module serves to contain all Odoo addons, across all configured addons
paths. For the code to manage those addons, see odoo.modules.
Addons are made available under `odoo.addons` after
odoo.tools.config.parse_config() is called (so that the addons paths are
known).
This module also conveniently reexports some symbols from odoo.modules.
Importing them from here is deprecated.
"""
# make odoo.addons a namespace package, while keeping this __init__.py
# present, for python 2 compatibility
# https://packaging.python.org/guides/packaging-namespace-packages/
__path__ = __import__('pkgutil').extend_path(__path__, __name__)