
setuptools-odoo Documentation Release 2.7.1.dev1+gf481c16 Stéphane Bidoul (ACSONE) Mar 15, 2021 Contents 1 Requirements 3 2 Packaging a single addon 5 3 Packaging multiple addons 9 4 Controlling setuptools-odoo behaviour 11 5 setuptools-odoo-make-default helper script 13 6 setuptools-odoo-get-requirements helper script 17 7 Versioning 19 8 Public API 21 9 Useful links 23 10 Credits 25 11 Changes 27 11.1 2.7.1 (2021-03-15)............................................ 27 11.2 2.7.0 (2021-03-13)............................................ 27 11.3 2.6.3 (2021-01-29)............................................ 27 11.4 2.6.2 (2021-01-13)............................................ 27 11.5 2.6.1 (unreleased)............................................ 28 11.6 2.6.0 (2020-10-21)............................................ 28 11.7 2.5.10 (2020-09-29)........................................... 28 11.8 2.5.9 (2020-05-25)............................................ 28 11.9 2.5.8 (2020-05-25)............................................ 28 11.10 2.5.7 (2020-05-07)............................................ 28 11.11 2.5.6 (2020-04-24)............................................ 28 11.12 2.5.5 (2020-03-06)............................................ 28 11.13 2.5.4 (2020-02-16)............................................ 28 11.14 2.5.3 (2020-01-16)............................................ 29 11.15 2.5.2 (2020-01-16)............................................ 29 11.16 2.5.1 (2019-12-13)............................................ 29 11.17 2.5.0 (2019-10-04)............................................ 29 i 11.18 2.4.1 (2018-11-05)............................................ 29 11.19 2.4.0 (2018-10-04)............................................ 29 11.20 2.3.0 (2018-05-13)............................................ 29 11.21 2.2.1 (2018-05-08)............................................ 29 11.22 2.2.0 (2018-04-30)............................................ 30 11.23 2.1.0 (2018-04-22)............................................ 30 11.24 2.0.4 (2018-04-18)............................................ 30 11.25 2.0.3 (2018-04-18)............................................ 30 11.26 2.0.2 (2017-10-07)............................................ 30 11.27 2.0.1 (2017-10-02)............................................ 30 11.28 2.0.0 (2017-09-19)............................................ 30 11.29 1.0.1 (2017-04-08)............................................ 31 11.30 1.0.0 (2017-04-07)............................................ 31 11.31 1.0.0rc4 (2017-02-21).......................................... 31 11.32 1.0.0rc3 (2017-01-14).......................................... 31 11.33 1.0.0rc2 (2016-10-07).......................................... 31 11.34 1.0.0rc1 (2016-10-03).......................................... 31 11.35 1.0.0b7 (2016-09-22)........................................... 31 11.36 1.0.0b6 (2016-08-23)........................................... 32 11.37 1.0.0b5 (2016-05-03)........................................... 32 11.38 1.0.0b4 (2016-04-06)........................................... 32 11.39 1.0.0b3 (2016-02-10)........................................... 32 11.40 1.0.0b2 (2016-01-26)........................................... 32 11.41 1.0.0b1 (2015-12-29)........................................... 33 11.42 0.9.0 (2015-12-13)............................................ 33 12 Developer instructions 35 12.1 How to run tests............................................. 35 12.2 How to build the documentation..................................... 35 12.3 How to release.............................................. 35 ii setuptools-odoo Documentation, Release 2.7.1.dev1+gf481c16 setuptools-odoo is a library to help packaging Odoo addons with setuptools. It mainly populates the usual setup.py keywords from the Odoo manifest files. It enables the packaging and distribution of Odoo addons using standard python infrastructure (ie setuptools, pip, wheel, and pypi). Contents • setuptools-odoo – Requirements – Packaging a single addon – Packaging multiple addons – Controlling setuptools-odoo behaviour – setuptools-odoo-make-default helper script – setuptools-odoo-get-requirements helper script – Versioning – Public API – Useful links – Credits – Changes * 2.7.1 (2021-03-15) * 2.7.0 (2021-03-13) * 2.6.3 (2021-01-29) * 2.6.2 (2021-01-13) * 2.6.1 (unreleased) * 2.6.0 (2020-10-21) * 2.5.10 (2020-09-29) * 2.5.9 (2020-05-25) * 2.5.8 (2020-05-25) * 2.5.7 (2020-05-07) * 2.5.6 (2020-04-24) * 2.5.5 (2020-03-06) * 2.5.4 (2020-02-16) * 2.5.3 (2020-01-16) Contents 1 setuptools-odoo Documentation, Release 2.7.1.dev1+gf481c16 * 2.5.2 (2020-01-16) * 2.5.1 (2019-12-13) * 2.5.0 (2019-10-04) * 2.4.1 (2018-11-05) * 2.4.0 (2018-10-04) * 2.3.0 (2018-05-13) * 2.2.1 (2018-05-08) * 2.2.0 (2018-04-30) * 2.1.0 (2018-04-22) * 2.0.4 (2018-04-18) * 2.0.3 (2018-04-18) * 2.0.2 (2017-10-07) * 2.0.1 (2017-10-02) * 2.0.0 (2017-09-19) * 1.0.1 (2017-04-08) * 1.0.0 (2017-04-07) * 1.0.0rc4 (2017-02-21) * 1.0.0rc3 (2017-01-14) * 1.0.0rc2 (2016-10-07) * 1.0.0rc1 (2016-10-03) * 1.0.0b7 (2016-09-22) * 1.0.0b6 (2016-08-23) * 1.0.0b5 (2016-05-03) * 1.0.0b4 (2016-04-06) * 1.0.0b3 (2016-02-10) * 1.0.0b2 (2016-01-26) * 1.0.0b1 (2015-12-29) * 0.9.0 (2015-12-13) – Developer instructions * How to run tests * How to build the documentation * How to release 2 Contents CHAPTER 1 Requirements The following prerequisites apply: • Odoo version 8, 9, 10, 11, 12, 13 and 14 are supported (see notes in the documentation for implementation differences). • To install addons packaged with this tool, any pip version that supports the wheel package format should work (ie pip >= 1.4). • For any advanced use such as installing from source, installing from git, packaging wheels etc, you need a recent version of pip (>= 9.0.1). • Finally, if you are using Odoo 8, 9 or 10, you need to install odoo-autodiscover( pip install odoo-autodiscover) to provide automatic extension of the addons path (and workaround a bug with se- tuptools > 31 and Odoo 10). odoo-autodiscover is not necessary for Odoo >= 11. 3 setuptools-odoo Documentation, Release 2.7.1.dev1+gf481c16 4 Chapter 1. Requirements CHAPTER 2 Packaging a single addon To be packaged with this library, the addon source code must have the following structure (assuming the addon is named <addon_name>): # Odoo >= 11 setup.py odoo/ odoo/addons/ odoo/addons/<addon_name>/ odoo/addons/<addon_name>/__manifest__.py odoo/addons/<addon_name>/... # Odoo 10 setup.py odoo/ odoo/__init__.py odoo/addons/ odoo/addons/__init__.py odoo/addons/<addon_name>/ odoo/addons/<addon_name>/__manifest__.py odoo/addons/<addon_name>/... # Odoo 8, 9 setup.py odoo_addons/ odoo_addons/__init__.py odoo_addons/<addon_name>/ odoo_addons/<addon_name>/__openerp__.py odoo_addons/<addon_name>/... where odoo/__init__.py, odoo/addons/__init__.py, and odoo_addons/__init__.py are stan- dard python namespace package declaration __init__.py (note __init__.py is absent for Odoo >= 11): __import__('pkg_resources').declare_namespace(__name__) and where setup.py has the following content: 5 setuptools-odoo Documentation, Release 2.7.1.dev1+gf481c16 import setuptools setuptools.setup( setup_requires=['setuptools-odoo'], odoo_addon=True, ) The usual setup() keyword arguments are computed automatically from the Odoo manifest file (__manifest__.py or __openerp__.py) and contain: • name: the package name, odoo<series>-addon-<addon_name> • version: the version key from the manifest • description: the summary key from the manifest if it exists otherwise the name key from the manifest • long_description: the content of the README.rst file if it exists, otherwise the description key from the manifest • url: the website key from the manifest • license: the license key from the manifest • packages: autodetected packages • namespace_packages: ['odoo', 'odoo.addons'] (Odoo 10) or ['odoo_addons'] (Odoo 8, 9), absent for Odoo 11 • zip_safe: False • include_package_data: True • install_requires: dependencies to Odoo, other addons (except official odoo community and enterprise addons, which are brought by the Odoo dependency) and python libraries. • python_requires Then, the addon can be deployed and packaged with usual setup.py or pip commands such as: python setup.py install python setup.py develop python setup.py bdist_wheel pip install odoo<8|9|10|11|12|13|14>-addon-<addon name> pip install-e. pip install-e git+https://github.com/OCA/<repo>/<addon> #egg=odoo ,!<8|9|10|11|12|13|14>-addon-<addon name>\&subdirectory=setup/<addon name> Note: When using pip to install from source, the -e option is important because of pip issue #3500. The -e option has the huge advantage of letting pip freeze produce meaningful output. When odoo-server-autodiscover is installed, The addons-path is automatically populated with all places providing odoo addons installed with this method. It is of course highly recommanded to run in a virtualenv. Note: Odoo 8, 9 namespace. Although the addons are packaged in the odoo_addons namespace, the code can still import them using import odoo.addons..... odoo_addons must never appear in the code, it is just a packaging 6 Chapter 2. Packaging a single addon setuptools-odoo Documentation, Release 2.7.1.dev1+gf481c16 peculiarity for Odoo 8 and 9 only, and does not require any change to the addons source code. 7 setuptools-odoo Documentation, Release 2.7.1.dev1+gf481c16 8 Chapter 2. Packaging a single addon CHAPTER 3 Packaging multiple addons Addons that are intended to be reused or depended upon by other addons
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages39 Page
-
File Size-