12
Using the pip package manager for Odoo Daniel Reis | OpenDays 2014

Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Embed Size (px)

DESCRIPTION

Discussing a solution to package Odoo/OpenERP modules in pip installable packages, providing a public index for them, and installing using the pip python tool.

Citation preview

Page 1: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Using the pip package manager for Odoo

Daniel Reis | OpenDays 2014

Page 2: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Who am I

Daniel Reis– Applications Manager at Securitas Portugal– 15+ years in IT, most as a consultant– 3 yrs working with Odoo/OpenERP– Active participant in the Odoo Community

Page 3: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Why pip?

Python recommended tool to install packages.

Good tooling support:• – virtualenv• – freeze, requirements.txt.• Why not?

Page 4: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Issues to address● How to build the pip packages?

– setup.py for server & addons.– Package version numbers.– Support for “series” (v7, v8) .– Automate the builds for module repos.

● How to distribute packages?– Use PyPi? Or create another index?

Page 5: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

What do we need to consider?

i. Build module packagesi. Build module packages

ii. Distribute packagesii. Distribute packages

iii. Install and updateiii. Install and update

Page 6: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

i. Getting packages builtTemplate setup.py for modules*– Target into site-packages/openerp/addons/– Versions: bzr revno; git/hg unix timestamp.→ →– A build tool: pipo build command

Modified Server setup.py*– Packaged as “openerp-base”– Add basic web dependencies

* Based on Vo Minh Thu's work: https://github.com/noteed/openerpdist

Page 7: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

pipo: pip for OpenERP

Module packager: build command.

Wrapper around pip (todo!):– install and update modules.– “glue” pip with server commands.

Source: https://github.com/dreispt/pipo

● $ pipo build ./addons-dir ./pkgs-dir

● $ pipo install openerp-sale

Page 8: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Pypi-line index distribution openerpapps.info– Channels/series: openerp/8.0, ocb/7.0, …– Server dependencies included in Index: skip PyPi.Automated builds with pipo.py– Only changed modules are rebuilt.– Multiple vcs support: bzr, git, hg.

ii. Distributing the packages

Page 9: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Iii. Installation the pip way

● $ virtualenv --system-site-packages mydemo

● $ source mydemo/bin/activate

$ pip install --index-url \ http://openerpapps.info/simple/openerp/7.0 \ openerp-sale

Page 10: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

● Distribute “Apps”, or maybe “Repos”?– autoinstall glue modules– res.config module installation

● Painless pip install– Wrap pip “boilerplate” options– pip install/update server install/update→

● Painless server provisioning– Script additional config tasks

● Missing CLI capabilities– Update module list, uninstall

● Webclient GUI?

Issues still to address

Page 11: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Developers? – Provide the simplest way to install OdooIntegrators? – Allow pip to be a part of dev and ops workflows. End-users? – Ease community Apps & Features discovery.

Where can we go?

Page 12: Using the "pip" package manager for Odoo/OpenERP - Opendays 2014

Thank you !

@reis_pt | dgreis(at)sapo.pt