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

  • View
    1.704

  • Download
    0

  • Category

    Software

Preview:

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

Using the pip package manager for Odoo

Daniel Reis | 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

Why pip?

Python recommended tool to install packages.

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

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?

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

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

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

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

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

● 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

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?

Thank you !

@reis_pt | dgreis(at)sapo.pt