Merge lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict into lp:~jbaudoux/anybox.recipe.openerp/20130908_relative_paths

Proposed by Stefan Rijnhart (Opener)
Status: Work in progress
Proposed branch: lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict
Merge into: lp:~jbaudoux/anybox.recipe.openerp/20130908_relative_paths
Diff against target: 5948 lines (+3990/-991)
57 files modified
.bzrignore (+1/-0)
CHANGES.rst (+45/-5)
MANIFEST.in (+1/-0)
README.rst (+75/-0)
anybox/recipe/openerp/base.py (+49/-31)
anybox/recipe/openerp/runtime/__init__.py (+39/-0)
anybox/recipe/openerp/runtime/backports/__init__.py (+1/-0)
anybox/recipe/openerp/runtime/backports/cli/__init__.py (+1/-0)
anybox/recipe/openerp/runtime/backports/cli/server.py (+87/-0)
anybox/recipe/openerp/runtime/session.py (+317/-31)
anybox/recipe/openerp/runtime/start_openerp.py (+43/-1)
anybox/recipe/openerp/runtime/tests/__init__.py (+1/-0)
anybox/recipe/openerp/runtime/tests/test_import_registry.py (+1/-1)
anybox/recipe/openerp/runtime/upgrade.py (+153/-0)
anybox/recipe/openerp/server.py (+50/-7)
anybox/recipe/openerp/tests/test_server.py (+3/-3)
anybox/recipe/openerp/tests/test_utils.py (+25/-0)
anybox/recipe/openerp/upgrade.py.tmpl (+19/-0)
anybox/recipe/openerp/utils.py (+34/-7)
anybox/recipe/openerp/vcs/bzr.py (+9/-2)
anybox/recipe/openerp/vcs/git.py (+2/-1)
anybox/recipe/openerp/vcs/tests/test_bzr.py (+33/-3)
anybox/recipe/openerp/vcs/tests/test_git.py (+3/-0)
buildbot/MANIFEST.cfg (+56/-27)
buildbot/base_recipe.cfg (+24/-0)
buildbot/recipe-50.cfg (+1/-18)
buildbot/recipe-60-custom.cfg (+9/-18)
buildbot/recipe-60.cfg (+2/-11)
buildbot/recipe-61-custom.cfg (+2/-12)
buildbot/recipe-61.cfg (+1/-10)
buildbot/recipe-7.0.cfg (+1/-12)
buildbot/recipe-latest.cfg (+2/-11)
buildbot/recipe-nightly.cfg (+1/-10)
buildbot/recipe-trunk.cfg (+1/-11)
buildbot/stable-recipe-50.cfg (+4/-0)
buildbot/stable-recipe-60.cfg (+4/-0)
buildbot/stable-recipe-61.cfg (+4/-0)
buildbot/stable-recipe-7.0.cfg (+0/-42)
buildbot/stable-recipe-nightly.cfg (+4/-0)
doc/Makefile (+177/-0)
doc/apidoc/anybox.recipe.openerp.rst (+75/-0)
doc/apidoc/anybox.recipe.openerp.runtime.rst (+50/-0)
doc/apidoc/anybox.recipe.openerp.vcs.rst (+59/-0)
doc/conf.py (+247/-0)
doc/configuration.rst (+613/-713)
doc/contributing.rst (+187/-0)
doc/dev_prod_workflow.rst (+32/-0)
doc/first_steps.rst (+351/-0)
doc/index.rst (+79/-0)
doc/scripts.rst (+471/-0)
doc/sphinx_static/default.css (+267/-0)
doc/sphinx_templates/layout.html (+203/-0)
setup.py (+5/-3)
test-cover (+1/-1)
tests_with_openerp/README.txt (+1/-0)
tests_with_openerp/data/VERSION.txt (+5/-0)
tests_with_openerp/test_version.py (+59/-0)
To merge this branch: bzr merge lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict
Reviewer Review Type Date Requested Status
Jacques-Etienne Baudoux Pending
Review via email: mp+205084@code.launchpad.net

Description of the change

Update with trunk branch to resolve a small conflict (ll.1200-1202 in the diff).

To post a comment you must log in.
425. By Stefan Rijnhart (Opener)

[FIX] Use unquoted substitution

Unmerged revisions

425. By Stefan Rijnhart (Opener)

[FIX] Use unquoted substitution

424. By Stefan Rijnhart (Opener)

[MRG] Update with target branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2013-09-07 12:04:02 +0000
+++ .bzrignore 2014-02-06 07:42:46 +0000
@@ -11,3 +11,4 @@
11buildbot/develop-eggs/11buildbot/develop-eggs/
12buildbot/etc/12buildbot/etc/
13buildbot/parts/13buildbot/parts/
14doc/sphinx_build
1415
=== modified file 'CHANGES.rst'
--- CHANGES.rst 2013-09-07 11:43:18 +0000
+++ CHANGES.rst 2014-02-06 07:42:46 +0000
@@ -1,13 +1,53 @@
1Changes1Changes
2~~~~~~~2~~~~~~~
33
41.8.0 (unreleased)4The 1.7 series are stable versions, while the 1.8 are unstable.
5------------------5Changes displayed as "unreleased" in th stable series are released
6with any higher released unstable versions.
7
81.8.2 (unreleased)
9------------------
10- launchpad #1275168: when freeze nightly version was not set correctly
11- launchpad #1245261: new ``--init-all`` option in ``test_openerp``
12 and ``start_openerp`` scripts.
13
141.8.1 (2013-10-17)
15------------------
16- launchpad #1235946 (demo data): consistent behaviour and capability
17 to load them.
18- launchpad #1239721: now session has 'is_initialization' attribute for
19 creation use-cases of upgrade script; using it to improve logging,
20 and in default upgrade script.
21
22
231.8.0 (2013-10-01)
24------------------
25- launchpad #1222482: upgrade toolkit and upgrade scripts generation
6- launchpad #1222116: [Gunicorn] option to preload databases26- launchpad #1222116: [Gunicorn] option to preload databases
727
81.7.2 (unreleased)281.7.4 (unreleased)
9------------------29------------------
1030- launchpad #1246822: restored the ordering of addons_path as it was
31 in 1.7.0 (main addons first).
32
331.7.3 (2013-10-17)
34------------------
35- Fixed the licence in ``setup.py`` and hence on PyPI page. The ZPL
36 indicated was contradictory with what is stated on Launchpad's
37 project page, and plain non applicable, since the recipe *does* import
38 from OpenERP.
39- launchpad #1232806: custom interpreter and openerp_scripts now work
40 with OpenERP 6.1
41- launchpad #1233606: [bzr] lightweight checkout now respects --offline
42
431.7.2 (2013-09-29)
44------------------
45- launchpad #1232724: [gunicorn] properly switching openerp to
46 multi-process mode
47- SAAS versions now recognized, and treated as X.5
48- launchpad #1228997: [v5] in some cases, start_openerp --stop-after-init was
49 not honoured.
50- launchpad #1222562: [git] error in extract-downloads-to
1151
121.7.1 (2013-09-07)521.7.1 (2013-09-07)
13------------------53------------------
1454
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2012-11-07 18:41:15 +0000
+++ MANIFEST.in 2014-02-06 07:42:46 +0000
@@ -2,3 +2,4 @@
2include anybox/recipe/openerp/openerp-cron-worker2include anybox/recipe/openerp/openerp-cron-worker
3include buildbot/*.cfg3include buildbot/*.cfg
4include buildbot/bootstrap.py4include buildbot/bootstrap.py
5include anybox/recipe/openerp/upgrade.py.tmpl
5\ No newline at end of file6\ No newline at end of file
67
=== added file 'README.rst'
--- README.rst 1970-01-01 00:00:00 +0000
+++ README.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,75 @@
1OpenERP buildout recipe
2=======================
3This recipe for `Buildout <https://github.com/buildout/buildout>`_ is
4a fully featured tool allowing you to define and deploy quickly
5OpenERP installations of any kinds, ranging from development setups to
6fully automated production deployments or continuous integration.
7
8Some of its main features include:
9
10* uniformity across OpenERP versions (from 5.0 onwards)
11* installation of OpenERP server and, if meaningful, GTK and web clients.
12* retrieval of main software and addons from various sources,
13 including the major version control systems
14* ability to pinpoint everything for replayability
15* management of OpenERP configuration
16* dedicated scripts creation for easy integration of external tools,
17 such as test launchers
18* packaging: creation of self-contained equivalents for easy
19 deployment in tightly controlled hosting environmenents.
20
21All these to be considered together with zc.buildout‘s general
22properties, such as an extensible configuration file format for easy
23variation or separation of concerns, native Python distributions
24installation, and of course the huge ecosystem of other recipes.
25
26The `full documentation
27<http://pythonhosted.org/anybox.recipe.openerp>`_
28is written with `Sphinx
29<http://sphinx-doc.org>`_, built continuously and
30uploaded to http://docs.anybox.fr/anybox.recipe.openerp by Anybox' public
31buildbot.
32The Sphinx source tree is to be found under the ``doc`` subdirectory
33of this project.
34
35The latest released version of the documentation is uploaded to PyPI
36alongside with the package. See `PyPIDocumentationHosting
37<https://wiki.python.org/moin/PyPiDocumentationHosting>`_ for details.
38
39Bug reports and Feedback
40~~~~~~~~~~~~~~~~~~~~~~~~
41Please don't hesitate to give feedback and especially report bugs or
42ask for new features through launchpad at this URL:
43https://bugs.launchpad.net/anybox.recipe.openerp/+bugs
44
45Useful links
46~~~~~~~~~~~~
47
48* Code repository and bug tracker: https://launchpad.net/anybox.recipe.openerp
49* PyPI page: http://pypi.python.org/pypi/anybox.recipe.openerp
50* Main documentation: http://docs.anybox.fr/anybox.recipe.openerp
51
52
53Contributors information
54~~~~~~~~~~~~~~~~~~~~~~~~
55
56See `the latest version of the contributors documentation
57<http://docs.anybox.fr/anybox.recipe.openerp/trunk/contributing.html>`_.
58
59
60Credits
61~~~~~~~
62
63Authors:
64
65 * Christophe Combelles
66 * Georges Racinet
67
68Contributors:
69
70 * Jean-Sébastien Suzanne
71 * Yannick Vaucher
72 * Jacques-Etienne Baudoux
73 * Laurent Mignon
74 * Leonardo Pistone
75
076
=== modified file 'anybox/recipe/openerp/base.py'
--- anybox/recipe/openerp/base.py 2013-09-08 13:48:02 +0000
+++ anybox/recipe/openerp/base.py 2014-02-06 07:42:46 +0000
@@ -37,6 +37,13 @@
3737
38class MainSoftware(object):38class MainSoftware(object):
39 """Placeholder to represent the main software instead of an addon location.39 """Placeholder to represent the main software instead of an addon location.
40
41 Should just have a singleton instance: :data:`main_software`,
42 whose meaning depends on the concrete recipe class using it.
43
44 For example, in :class:`anybox.recipe.openerp.server.ServerRecipe`,
45 :data:`main_software` represents the OpenObject server or the OpenERP
46 standard distribution.
40 """47 """
4148
42 def __str__(self):49 def __str__(self):
@@ -51,24 +58,32 @@
51 """Base class for other recipes.58 """Base class for other recipes.
5259
53 It implements notably fetching of the main software part plus addons.60 It implements notably fetching of the main software part plus addons.
54 The ``sources`` attributes is a dict storing how to fetch the main software61
55 part and specified addons. It has the following structure:62 The :attr:`sources` attribute is a ``dict`` storing how to fetch the main
5663 software part and the specified addons, with the following structure:
57 local path -> (type, location_spec, options).64
5865 ``local path -> (type, location_spec, options)``, in which:
59 where local path is the ``main_software`` object for the main software66
60 part, and otherwise a local path to an addons container.67 :local path: is either the :data:`main_software` singleton
6168 (see :class:`MainSoftware`) or a local path to an
62 type can be69 addons directory.
63 - 'local'70 :type: can be either
64 - 'downloadable'71
65 - one of the supported vcs72 * ``'local'``
6673 * ``'downloadable'``
67 location_spec is, depending on the type, a tuple specifying how to74 * one of the supported vcs
68 fetch : (url, None), or (vcs_url, vcs_revision) or None75
6976 :location_spec: is, depending on the type, a tuple specifying how
70 addons options are typically used to specify that the addons directory77 fetch is to be done:
71 is actually a subdir of the specified one.78
79 ``(url, None)``, or ``(vcs_url, vcs_revision)``
80 or ``None``
81 :addons options: are typically used to specify that the addons
82 directory is actually a subdir of the specified one.
83
84 VCS support classes (see
85 :mod:`anybox.recipe.openerp.vcs`) can implemented their
86 dedicated options
7287
73 """88 """
7489
@@ -164,7 +179,7 @@
164 self.parse_revisions(options)179 self.parse_revisions(options)
165180
166 def parse_version(self):181 def parse_version(self):
167 """Set the main software in ``sources`` and related attributes.182 """Set the main software in :attr:`sources` and related attributes.
168 """183 """
169 self.version_wanted = self.options.get('version')184 self.version_wanted = self.options.get('version')
170 if self.version_wanted is None:185 if self.version_wanted is None:
@@ -438,9 +453,9 @@
438 os.putenv('PYTHONPATH', pythonpath_bak)453 os.putenv('PYTHONPATH', pythonpath_bak)
439454
440 def parse_addons(self, options):455 def parse_addons(self, options):
441 """Parse the addons options into the ``sources`` attribute.456 """Parse the addons options into :attr:`sources`.
442457
443 See ``BaseRecipe`` docstring for details about the ``sources`` dict.458 See :class:`BaseRecipe` for the structure of :attr:`sources`.
444 """459 """
445460
446 for line in options.get('addons', '').split(os.linesep):461 for line in options.get('addons', '').split(os.linesep):
@@ -462,11 +477,13 @@
462 self.sources[addons_dir] = (loc_type, location_spec, options)477 self.sources[addons_dir] = (loc_type, location_spec, options)
463478
464 def parse_revisions(self, options):479 def parse_revisions(self, options):
465 """Parse revisions options and update the ``sources`` attribute.480 """Parse revisions options and update :attr:`sources`.
466481
467 It is assumed that ``sources`` has already been populated, and482 It is assumed that :attr:`sources` has already been populated, and
468 notably has a main_software part.483 notably has a :data:`main_software` entry.
469 This allows for easy fixing of revisions in an extension buildout484 This allows for easy fixing of revisions in an extension buildout
485
486 See :class:`BaseRecipe` for the structure of :attr:`sources`.
470 """487 """
471 for line in options.get('revisions', '').split(os.linesep):488 for line in options.get('revisions', '').split(os.linesep):
472 # GR inline comment should have not gone through, but sometimes489 # GR inline comment should have not gone through, but sometimes
@@ -505,11 +522,9 @@
505 + source[2:])522 + source[2:])
506523
507 def retrieve_addons(self):524 def retrieve_addons(self):
508 """Parse the addons option line, download and return a list of paths.525 """Peform all lookup and downloads specified in :attr:`sources`.
509526
510 syntax: repo_type repo_url repo_dir repo_rev [options]527 See :class:`BaseRecipe` for the structure of :attr:`sources`.
511 or an absolute or relative path
512 options are themselves in the key=value form
513 """528 """
514 self.addons_paths = []529 self.addons_paths = []
515 for local_dir, source_spec in self.sources.items():530 for local_dir, source_spec in self.sources.items():
@@ -623,7 +638,10 @@
623 logger.info("No need to re-download %s", self.archive_path)638 logger.info("No need to re-download %s", self.archive_path)
624639
625 def retrieve_main_software(self):640 def retrieve_main_software(self):
626 """install server, webclient or gtkclient."""641 """Lookup or fetch the main software.
642
643 See :class:`MainSoftware` and :class:`BaseRecipe` for explanations.
644 """
627645
628 source = self.sources[main_software]646 source = self.sources[main_software]
629 type_spec = source[0]647 type_spec = source[0]
@@ -751,7 +769,7 @@
751 def dump_nightly_latest_version(self):769 def dump_nightly_latest_version(self):
752 """After download/analysis of 'nightly latest', give equivalent spec.770 """After download/analysis of 'nightly latest', give equivalent spec.
753 """771 """
754 return ' '.join((self.nightly_series, 'nightly', self.nightly_version))772 return ' '.join(('nightly', self.nightly_series, self.nightly_version))
755773
756 def freeze_to(self, out_config_path):774 def freeze_to(self, out_config_path):
757 """Create an extension buildout freezing current revisions & versions.775 """Create an extension buildout freezing current revisions & versions.
@@ -1141,7 +1159,7 @@
1141 else:1159 else:
1142 base_addons = join(self.openerp_dir, 'openerp', 'addons')1160 base_addons = join(self.openerp_dir, 'openerp', 'addons')
1143 if os.path.exists(base_addons):1161 if os.path.exists(base_addons):
1144 self.addons_paths.append(base_addons)1162 self.addons_paths.insert(0, base_addons)
11451163
1146 if check_existence:1164 if check_existence:
1147 for path in self.addons_paths:1165 for path in self.addons_paths:
11481166
=== added directory 'anybox/recipe/openerp/runtime'
=== added file 'anybox/recipe/openerp/runtime/__init__.py'
--- anybox/recipe/openerp/runtime/__init__.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/runtime/__init__.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,39 @@
1"""
2Runtime
3=======
4
5This subpackage provides encapsulations and entry points for the application
6itself:
7
8* the ``session`` module features the supporting objects for "OpenERP scripts"
9 and the dedicated python interpreter.
10* the ``start_openerp`` and ``test_openerp`` modules are the entry points for
11 the main startup scripts.
12
13This architecture is meant in particular to provide stability and uniformity
14accross OpenERP major versions, so that the recipe can be leveraged by
15automated deploymnent tools and continuous integration systems.
16"""
17
18_imported_addons = set()
19
20
21def already_imported(module_name):
22 """Convenience to help some OpenERP modules to avoid been imported twice.
23
24 Each call of this function returns a boolean indicated whether the
25 specified module was already in the ``imported_addons`` registry and add it
26 inconditionnally.
27
28 Thus caller code is expected to import the module right away if the
29 return value was False.
30 """
31 name = module_name.rsplit('.', 1)[-1]
32 if name in _imported_addons:
33 return True
34 _imported_addons.add(name)
35 return False
36
37
38def clear_import_registry():
39 _imported_addons.clear()
040
=== added directory 'anybox/recipe/openerp/runtime/backports'
=== added file 'anybox/recipe/openerp/runtime/backports/__init__.py'
--- anybox/recipe/openerp/runtime/backports/__init__.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/runtime/backports/__init__.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,1 @@
1# python package
02
=== added directory 'anybox/recipe/openerp/runtime/backports/cli'
=== added file 'anybox/recipe/openerp/runtime/backports/cli/__init__.py'
--- anybox/recipe/openerp/runtime/backports/cli/__init__.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/runtime/backports/cli/__init__.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,1 @@
1# python package
02
=== added file 'anybox/recipe/openerp/runtime/backports/cli/server.py'
--- anybox/recipe/openerp/runtime/backports/cli/server.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/runtime/backports/cli/server.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,87 @@
1# -*- coding: utf-8 -*-
2
3##############################################################################
4#
5# OpenERP, Open Source Management Solution
6# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22#
23# anybox.recipe.openerp is also under AGPL v3+
24#
25
26"""
27Copied from OpenERP 6.1's openerp-server startup script.
28
29This makes utilitary functions available to the session module.
30"""
31
32import logging
33import os
34import sys
35
36try:
37 import openerp
38except:
39 # this file must stay importable by nose tests
40 pass
41else:
42 __author__ = openerp.release.author
43 __version__ = openerp.release.version
44
45 if openerp.release.version_info < (6, 1):
46 raise RuntimeError("Interpreter and scripts not compatible "
47 "with OpenERP < 6.1")
48
49# Also use the `openerp` logger for the main script.
50_logger = logging.getLogger('openerp')
51
52
53def check_root_user():
54 """ Exit if the process's user is 'root' (on POSIX system)."""
55 if os.name == 'posix':
56 import pwd
57 if pwd.getpwuid(os.getuid())[0] == 'root':
58 sys.stderr.write("Running as user 'root' is a security risk, "
59 "aborting.\n")
60 sys.exit(1)
61
62
63def check_postgres_user():
64 """ Exit if the configured database user is 'postgres'.
65
66 This function assumes the configuration has been initialized.
67 """
68 config = openerp.tools.config
69 if config['db_user'] == 'postgres':
70 sys.stderr.write("Using the database user 'postgres' is a "
71 "security risk, aborting.")
72 sys.exit(1)
73
74
75def report_configuration():
76 """ Log the server version and some configuration values.
77
78 This function assumes the configuration has been initialized.
79 """
80 config = openerp.tools.config
81 _logger.info("OpenERP version %s", __version__)
82 for name, value in [('addons paths', config['addons_path']),
83 ('database hostname',
84 config['db_host'] or 'localhost'),
85 ('database port', config['db_port'] or '5432'),
86 ('database user', config['db_user'])]:
87 _logger.info("%s: %s", name, value)
088
=== renamed file 'anybox/recipe/openerp/patch_openerp_v5.py' => 'anybox/recipe/openerp/runtime/patch_openerp_v5.py'
=== renamed file 'anybox/recipe/openerp/startup.py' => 'anybox/recipe/openerp/runtime/session.py'
--- anybox/recipe/openerp/startup.py 2013-07-24 15:59:29 +0000
+++ anybox/recipe/openerp/runtime/session.py 2014-02-06 07:42:46 +0000
@@ -1,69 +1,369 @@
1"""Utilities to start a server process."""1"""Utilities to start a server process."""
2import warnings2import warnings
3import sys3import sys
4import os
4import logging5import logging
6from distutils.version import Version
7
8
5try:9try:
6 import openerp10 import openerp
7except ImportError:11except ImportError:
8 warnings.warn("This must be imported with a buildout openerp recipe "12 warnings.warn("This must be imported with a buildout openerp recipe "
9 "driven sys.path", RuntimeWarning)13 "driven sys.path", RuntimeWarning)
10else:14else:
11 from openerp.cli import server as startup15 try:
16 from openerp.cli import server as startup
17 except ImportError:
18 from .backports.cli import server as startup
12 from openerp.tools import config19 from openerp.tools import config
20 from openerp import SUPERUSER_ID
21 from openerp.tools.parse_version import parse_version
22
13from optparse import OptionParser # we support python >= 2.623from optparse import OptionParser # we support python >= 2.6
1424
15logger = logging.getLogger(__name__)25logger = logging.getLogger(__name__)
1626
27DEFAULT_VERSION_PARAMETER = 'buildout.db_version'
28
29DEFAULT_VERSION_FILE = 'VERSION.txt'
30
31
32class OpenERPVersion(Version):
33 """OpenERP idea of version, wrapped in a class.
34
35 This is based on :meth:`openerp.tools.parse_version`, and
36 Provides straight-ahead comparison with tuples of integers, or
37 distutils Version classes.
38 """
39
40 def parse(self, incoming):
41 if isinstance(incoming, OpenERPVersion):
42 self.vstring = incoming.vstring
43 self.components = incoming.components
44 else:
45 self.vstring = incoming
46 self.components = parse_version(incoming)
47
48 def __str__(self):
49 return self.vstring
50
51 def __repr__(self):
52 return 'OpenERPVersion(%r)' % str(self)
53
54 def __cmp__(self, other):
55 if isinstance(other, tuple):
56 other = '.'.join(str(s) for s in other)
57 elif not isinstance(other, self.__class__):
58 other = str(other) # Works with distutils' Version classes
59
60 other = self.__class__(other)
61 return cmp(self.components, other.components)
62
1763
18class Session(object):64class Session(object):
19 """A class to represent the server object.65 """A class to give server-level access to one database.
2066
21 you should have exactly one per process.67 There should be exactly one instance of this class per process.
2268 It can be used for any kind of script involving OpenERP API, and provides
23 Before actual use, call the ``bootstrap`` method.69 facilities for upgrade scripts (see also
24 Then you have useful attributes/methods behaving like unit test classes:70 :mod:anybox.recipe.openerp.runtime.upgrade)
2571
26 self.cr: a cursor72 Before actual use, call :meth:`open`.
27 self.uid: user id73 Then you'll have useful attributes and methods reminiscent of the unit test
74 classes:
75
76 * :attr:`cr`: a cursor
77 * :attr:`uid`: user id
78 * :attr:`registry`: access to model objects
79 * :attr:`is_initialization`: True if and only if the database was not
80 initialized before the call to :meth:`open`
81
82 Example application code::
83
84 session.open(db_name="my_db")
85 admin = session.registry('res_users').browse(session.cr, session.uid, 1)
86 (...)
87 session.cr.commit()
88 session.close()
89
90 Transaction management is up to user code
91
92 Upgrade scripts writers should check the version handling properties:
93
94 * :meth:`db_version`
95 * :meth:`package_version`
96
97 Instantiation is done by passing the path to OpenERP main
98 configuration file and the path of the buildout directory.
99
100 Usually, instantiation code is written by the recipe in the body of the
101 executable "OpenERP scripts" it produces.
102 Script writers provide a callable that takes a
103 :class:`.Session` object argument and declare it as a console script entry
104 point in their distribution.
105 End users can reference such entry points in their buildout configurations
106 to have buildout produce the actual executable. See :doc:`/scripts`
107 for details.
108
109 Upgrade scripts are a special case of that process, in which the entry
110 point is actually provided by the recipe and rewraps a user-level
111 source script.
112
113 Later versions of the recipe may find a way to pass the whole buildout
114 configuration (recall that this is to be used in a separate process in
115 which the buildout configuration has not been parsed).
28 """116 """
29117
30 def __init__(self, conffile):118 def __init__(self, conffile, buildout_dir, parse_config=True):
119 self.buildout_dir = buildout_dir
120 self.openerp_config_file = conffile
121
31 self._registry = self.cr = None122 self._registry = self.cr = None
32 config.parse_config(['-c', conffile])123 if parse_config:
124 config.parse_config(['-c', conffile])
33125
34 def ready(self):126 def ready(self):
35 return self._registry is not None127 return self._registry is not None
36128
37 def open(self, db=None):129 def open(self, db=None, with_demo=False):
130 """Load the database
131
132 Loading an empty database in OpenERP has the side effect of installing
133 the ``base`` module. Whether to loading demo data or not has therefore
134 to be decided right away.
135
136 :param db: database name. If not specified, the same cascading of
137 defaults as OpenERP mainstream will be applied:
138 configuration file, psycopg2/lipq defaults.
139 :param with_demo: controls the loading of demo data for all
140 module installations triggered by this call to
141 :meth:`open` and further uses of :meth:`load_modules`
142 on this :class:`Session` instance:
143
144 * if ``True``, demo data will uniformly be loaded
145 * if ``False``, no demo data will be loaded
146 * if ``None``, demo data will be loaded according to
147 the value of ``without_demo`` in configuration
148
149 In all cases, the behaviour will stay consistent
150 until the next call of ``open()``, but the
151 implementation does not protect against any race
152 conditions in OpenERP internals.
153 """
38 if db is None:154 if db is None:
39 db = config['db_name']155 db = config['db_name']
40 if not db:156 if not db:
41 db = '' # default to OpenERP/psycopg2/lipbq default behaviour157 db = '' # expected value expected by OpenERP to start defaulting.
158
159 cnx = openerp.sql_db.db_connect(db)
160 cr = cnx.cursor()
161 self.is_initialization = not(openerp.modules.db.is_initialized(cr))
162 cr.close()
163
42 startup.check_root_user()164 startup.check_root_user()
43 startup.check_postgres_user()165 startup.check_postgres_user()
44 openerp.netsvc.init_logger()166 openerp.netsvc.init_logger()
167
168 saved_without_demo = config['without_demo']
169 if with_demo is None:
170 with_demo = config['without_demo']
171
172 config['without_demo'] = not with_demo
173 self.with_demo = with_demo
174
45 self._registry = openerp.modules.registry.RegistryManager.get(175 self._registry = openerp.modules.registry.RegistryManager.get(
46 db, update_module=False)176 db, update_module=False)
177 config['without_demo'] = saved_without_demo
47 self.init_cursor()178 self.init_cursor()
179 self.uid = SUPERUSER_ID
180
181 # A later version might read that from buildout configuration.
182 _version_parameter_name = DEFAULT_VERSION_PARAMETER
183
184 @property
185 def version_file_path(self):
186 """Absolute path of the flat file storing the package version.
187
188 For now this is not configurable, a later version might read it
189 from buildout configuration.
190 """
191 return os.path.join(self.buildout_dir, DEFAULT_VERSION_FILE)
192
193 def parse_version_string(self, vstring):
194 """Stable method for downstream code needing to instantiate a version.
195
196 This method returns an appropriate version instance, without
197 any dependency on where to import the class from. Especially useful
198 for applications whose life started before this set of utilities has
199 been used : this helps building an usable default.
200 """
201 return OpenERPVersion(vstring)
202
203 @property
204 def db_version(self):
205 """Settable property for version stored in DB of the whole buildout.
206
207 This can be thought as the latest version to which the DB has been
208 upgraded to.
209 A simple caching system to avoid querying the DB multiple times is
210 implemented.
211 """
212 db_version = getattr(self, '_db_version', None)
213 if db_version is not None:
214 return db_version
215
216 db_version = self.registry('ir.config_parameter').get_param(
217 self.cr, self.uid, self._version_parameter_name)
218 if not db_version:
219 # as usual OpenERP thinks its simpler to use False as None
220 # restoring sanity ASAP
221 db_version = None
222 else:
223 db_version = OpenERPVersion(db_version)
224 self._db_version = db_version
225 return db_version
226
227 @db_version.setter
228 def db_version(self, version):
229 self.registry('ir.config_parameter').set_param(
230 self.cr, self.uid, self._version_parameter_name, str(version))
231 self._db_version = OpenERPVersion(version)
232
233 @property
234 def package_version(self):
235 """Property reading the version file from buildout directory.
236
237 Comments introduced with a hash are accepted.
238 Only the first significant line is taken into account.
239 """
240 pkg_version = getattr(self, '_pkg_version', None)
241 if pkg_version is not None:
242 return pkg_version
243
244 try:
245 with open(self.version_file_path) as f:
246 for line in f:
247 line = line.split('#', 1)[0].strip()
248 if not line:
249 continue
250 self._pkg_version = OpenERPVersion(line)
251 return self._pkg_version
252 except IOError:
253 logger.info("No version file could be read, "
254 "package version considered to be None")
255
256 def update_modules_list(self):
257 """Update the list of available OpenERP modules, like the UI allows to.
258
259 This is necessary prior to install of any new module.
260 """
261 self.registry('ir.module.module').update_list(self.cr, self.uid)
48262
49 def init_cursor(self):263 def init_cursor(self):
50 self.cr = self._registry.db.cursor()264 self.cr = self._registry.db.cursor()
51265
52 def registry(self, model):266 def registry(self, model):
53 """Return the model object."""267 """Lookup model by name and return a ready-to-work instance."""
54 return self._registry.get(model)268 return self._registry.get(model)
55269
56 def rollback(self):270 def rollback(self):
57 self.cr.rollback()271 self.cr.rollback()
58272
59 def close(self):273 def close(self):
274 """Close the cursor and forget about the current database.
275
276 The session is thus ready to open another database.
277 """
278 dbname = self.cr.dbname
60 self.cr.close()279 self.cr.close()
280 openerp.modules.registry.RegistryManager.delete(dbname)
281
282 def update_modules(self, modules, db=None):
283 """Update the prescribed modules in the database.
284
285 :param db: Database name. If not specified, it is assumed to have
286 already been opened with :meth:`open`, e.g, for a prior
287 read of :meth:`db_version`.
288 If it is specified, then the session in particular opens
289 that db and will use it afterwards whether another one
290 was already opened or not.
291 :param modules: any iterable of module names.
292 Not installed modules will be ignored
293 The special name ``'all'`` triggers the update of
294 all installed modules.
295 """
296 if db is None:
297 if self.cr is None:
298 raise ValueError("update_modules needs either the session to "
299 "be opened or an explicit database name")
300 db = self.cr.dbname
301
302 if self.cr is not None:
303 self.close()
304 for module in modules:
305 config['update'][module] = 1
306 self._registry = openerp.modules.registry.RegistryManager.get(
307 db, update_module=True)
308 config['update'].clear()
309 self.init_cursor()
310
311 def install_modules(self, modules, db=None, update_modules_list=True,
312 open_with_demo=False):
313 """Install the modules in the database.
314
315 Has the side effect of closing the current cursor, committing if and
316 only if the list of modules is updated.
317
318 Demo data loading is handled consistently with the decision taken
319 by :meth:`open`.
320
321 :param db: Database name. If not specified, it is assumed to have
322 already been opened with :meth:`open`, e.g, for a prior
323 read of :meth:`db_version`.
324 If it is specified, then the session in particular opens
325 that db and will use it afterwards whether another one
326 was already opened or not.
327 :param modules: any iterable of module names.
328 :param update_modules_list: if True, will update the module lists
329 *and commit* before the install begins.
330 :param open_with_demo: if ``db`` is not None, will be passed to
331 :meth:`open`.
332 """
333 already_open = self.cr is not None
334 if db is None:
335 if not already_open:
336 raise ValueError("install_modules needs either the session to "
337 "be opened or an explicit database name")
338 db = self.cr.dbname
339 elif update_modules_list and not (
340 already_open and self.cr.dbname == db):
341 self.open(db=db, with_demo=open_with_demo)
342
343 if update_modules_list:
344 self.update_modules_list()
345 self.cr.commit()
346
347 if self.cr is not None:
348 self.close()
349 saved_without_demo = config['without_demo']
350
351 # with update_modules_list=False, an explicitely named DB would not
352 # have gone through open() yet.
353 config['without_demo'] = not getattr(self, 'with_demo', open_with_demo)
354 for module in modules:
355 config['init'][module] = 1
356 self._registry = openerp.modules.registry.RegistryManager.get(
357 db, update_module=True, force_demo=self.with_demo)
358 config['init'].clear()
359 config['without_demo'] = saved_without_demo
360 self.init_cursor()
61361
62 def handle_command_line_options(self, to_handle):362 def handle_command_line_options(self, to_handle):
63 """Handle prescribed command line options and eat them.363 """Handle prescribed command line options and eat them.
64364
65 Anything before first occurrence of '--' is ours and removed from365 Anything before first occurrence of ``--`` on the command-line is taken
66 sys.argv.366 into account and removed from ``sys.argv``.
67367
68 Help messages:368 Help messages:
69369
@@ -118,17 +418,3 @@
118 logger.info("No database specified, using the one specified "418 logger.info("No database specified, using the one specified "
119 "in buildout configuration.")419 "in buildout configuration.")
120 self.open(db=options.db_name)420 self.open(db=options.db_name)
121
122_imported_addons = set()
123
124
125def already_imported(module_name):
126 name = module_name.rsplit('.', 1)[-1]
127 if name in _imported_addons:
128 return True
129 _imported_addons.add(name)
130 return False
131
132
133def clear_import_registry():
134 _imported_addons.clear()
135421
=== renamed file 'anybox/recipe/openerp/start_openerp.py' => 'anybox/recipe/openerp/runtime/start_openerp.py'
--- anybox/recipe/openerp/start_openerp.py 2013-08-04 18:23:29 +0000
+++ anybox/recipe/openerp/runtime/start_openerp.py 2014-02-06 07:42:46 +0000
@@ -1,14 +1,38 @@
1"""This module bridges the classical ``openerp-server`` as a console script.
2
3The :func:`main` function gets registered on the fly by the server recipe as
4a console script entry point and used in particular for ``start_openerp`` and
5``test_openerp``.
6
7Some version independence logic for the startup process also get bootstrapped
8from here.
9"""
10
1import sys11import sys
2import os12import os
3from . import patch_openerp_v513from . import patch_openerp_v5
414
515
6def insert_args(arguments):16def insert_args(arguments):
17 """Insert `arguments` in ``sys.argv`` (direct impact on child script).
18 """
7 for i, a in enumerate(arguments):19 for i, a in enumerate(arguments):
8 sys.argv.insert(i+1, a)20 sys.argv.insert(i+1, a)
921
1022
11def main(starter, conf, version=None, just_test=False):23def main(starter, conf, version=None, just_test=False):
24 """Call the `starter` script, dispatching configuration.
25
26 All arguments are set in the standalone script produced by buildout through
27 entry point options.
28
29 :param starter: path to the main script source file (currently
30 ``openerp-server``)
31 :param conf: path to the OpenERP configuration file (managed by the recipe)
32 :param version: OpenERP major version
33 :type version: tuple of integers
34 :param just_test: if True, only run unit tests
35 """
12 arguments = ['-c', conf]36 arguments = ['-c', conf]
1337
14 if just_test:38 if just_test:
@@ -19,6 +43,16 @@
19 if version >= (7, 0):43 if version >= (7, 0):
20 arguments.append('--test-enable')44 arguments.append('--test-enable')
2145
46 if '--install-all' in sys.argv:
47 sys.argv.remove('--install-all')
48 from openerp.tools import config
49 # Maybe we should preparse config in all cases and therefore avoid
50 # adding the '-c' on the fly ?
51 # Still, cautious about pre-6.1 versions
52 config.parse_config(['-c', conf])
53 from openerp.modules import get_modules
54 arguments.extend(('-i', ','.join(get_modules())))
55
22 insert_args(arguments)56 insert_args(arguments)
2357
24 if version == (5, 0):58 if version == (5, 0):
@@ -28,4 +62,12 @@
28 glob = globals()62 glob = globals()
29 glob['__name__'] = '__main__'63 glob['__name__'] = '__main__'
30 glob['__file__'] = starter64 glob['__file__'] = starter
31 execfile(starter, globals())65 try:
66 execfile(starter, globals())
67 except SystemExit as exc:
68 if version == (5, 0):
69 # Without Agent.quit() the Timer threads may go on forever
70 # and the script will never stop
71 import netsvc
72 netsvc.Agent.quit()
73 return exc.code
3274
=== renamed file 'anybox/recipe/openerp/test_openerp.py' => 'anybox/recipe/openerp/runtime/test_openerp.py'
=== added directory 'anybox/recipe/openerp/runtime/tests'
=== added file 'anybox/recipe/openerp/runtime/tests/__init__.py'
--- anybox/recipe/openerp/runtime/tests/__init__.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/runtime/tests/__init__.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,1 @@
1# python package
02
=== renamed file 'anybox/recipe/openerp/tests/test_startup.py' => 'anybox/recipe/openerp/runtime/tests/test_import_registry.py'
--- anybox/recipe/openerp/tests/test_startup.py 2013-06-15 11:33:47 +0000
+++ anybox/recipe/openerp/runtime/tests/test_import_registry.py 2014-02-06 07:42:46 +0000
@@ -1,5 +1,5 @@
1from unittest import TestCase1from unittest import TestCase
2from ..startup import already_imported, clear_import_registry2from .. import already_imported, clear_import_registry
33
44
5class TestImportRegistry(TestCase):5class TestImportRegistry(TestCase):
66
=== added file 'anybox/recipe/openerp/runtime/upgrade.py'
--- anybox/recipe/openerp/runtime/upgrade.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/runtime/upgrade.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,153 @@
1"""Uniform encapsulation of buildout-local upgrade script.
2
3The idea is to provide a common set of options, so that upgrade scripts all
4have the same interface, and project maintainers can focus on the decision
5taking logic.
6"""
7import os
8import sys
9import imp
10import logging
11from argparse import ArgumentParser
12from argparse import ArgumentDefaultsHelpFormatter
13from argparse import SUPPRESS
14from datetime import datetime
15from math import ceil
16
17from .session import Session
18
19DEFAULT_LOG_FILE = 'upgrade.log'
20
21
22def upgrade(upgrade_script, upgrade_callable, conf, buildout_dir):
23 """Run the upgrade from a source file.
24
25 All arguments are set in the standalone script produced by buildout through
26 entry point options.
27
28 * ``upgrade_script``: absolute path to the upgrade script python source.
29 * ``upgrade_callable``: name of the callable in source file actually
30 running the script.
31
32 It must accept the two following positional arguments, in that order:
33
34 - a :class:`.Session` instance (as in standard "OpenERP scripts")
35 - a logger (standard object from the :mod:`logging` module)
36
37 and may return a non zero status code to indicate an error.
38 Both ``None`` and 0 are interpreted as success.
39
40 * ``conf``: path to the OpenERP configuration file (managed by the recipe)
41 * ``buildout_dir``: directory of the buildout
42 """
43
44 parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter,
45 epilog="")
46 parser.add_argument('--log-file', default=DEFAULT_LOG_FILE,
47 help="File to log sub-operations to, relative to the "
48 "current working directory, supports homedir "
49 "expansion ('~' on POSIX systems).")
50 parser.add_argument('--log-level', default='info',
51 help="Main OpenERP logging level. Does not affect the "
52 "logging from the main upgrade script itself.")
53 parser.add_argument('--console-log-level', default='info',
54 help="Level for the upgrade process console "
55 "logging. This is for the main upgrade script itself "
56 "meaning that usually only major steps should be "
57 "logged ")
58 parser.add_argument('-q', '--quiet', action='store_true',
59 help="Suppress console output from the main upgrade "
60 "script (lower level stages can still write)")
61 parser.add_argument('-d', '--db-name', default=SUPPRESS,
62 help="Database name. If ommitted, the general default "
63 "values from OpenERP config file or libpq will apply.")
64 parser.add_argument('--init-load-demo-data', action='store_true',
65 help="Demo data will be loaded with module "
66 "installations if and only if "
67 "this modifier is specified")
68
69 arguments = parser.parse_args() # 'args' would shadow the one of pdb
70 log_path = os.path.abspath(os.path.expanduser(arguments.log_file))
71 log_level = arguments.log_level
72 console_level = arguments.console_log_level.upper()
73 quiet = arguments.quiet
74
75 try:
76 log_file = open(log_path, 'a')
77 except IOError:
78 sys.stderr.write("Cannot open %r for write" % log_path + os.linesep)
79 sys.exit(-1)
80
81 session = Session(conf, buildout_dir)
82
83 from openerp.tools import config
84 config['logfile'] = log_path
85 config['log-level'] = log_level
86
87 start_time = datetime.utcnow()
88 if not quiet:
89 print("Starting upgrade, logging details to %s at level %s, "
90 "and major steps to console at level %s" % (
91 log_path, log_level.upper(), console_level.upper()))
92 print('')
93
94 logger = logging.getLogger('openerp.upgrade')
95 console_handler = logging.StreamHandler()
96 console_handler.setLevel(getattr(logging, console_level))
97 console_handler.setFormatter(logging.Formatter(
98 "%(asctime)s %(levelname)s %(message)s"))
99
100 if not arguments.quiet:
101 logger.addHandler(console_handler)
102
103 db_name = getattr(arguments, 'db_name', None)
104 logger.info("Opening database %r", db_name)
105 session.open(db=db_name, with_demo=bool(arguments.init_load_demo_data))
106 # actual value after all defaultings have been done
107 db_name = session.cr.dbname
108
109 if session.is_initialization:
110 logger.info("Database %r base initialization done. Proceeding further",
111 db_name)
112 else:
113 logger.info("Database %r loaded. Actual upgrade begins.", db_name)
114
115 pkg_version = session.package_version
116 if pkg_version is None:
117 logger.warn("Expected package version file %r does not exist. "
118 "version won't be set in database at the end of upgrade. "
119 "Consider including such a version file in your project "
120 "*before* version dependent logic is actually needed.",
121 session.version_file_path)
122 else:
123 logger.info("Read package version: %s from %s", pkg_version,
124 session.version_file_path)
125
126 db_version = session.db_version
127 if db_version is None:
128 if not session.is_initialization:
129 logger.warn("No version currently set in database (the present "
130 "upgrade script has never been run). Consider setting "
131 "database version even for fresh instances, to "
132 "eliminate any guesswork in the upgrade scripts.")
133 else:
134 logger.info("Database latest upgrade version : %s", db_version)
135
136 upgrade_module = imp.load_source('anybox.recipe.openerp.upgrade_openerp',
137 upgrade_script)
138 statuscode = getattr(upgrade_module, upgrade_callable)(session, logger)
139 if statuscode is None or statuscode == 0:
140 if pkg_version is not None:
141 logger.info("setting version %s in database" % pkg_version)
142 session.db_version = pkg_version
143 session.cr.commit()
144
145 logger.info("%s successful. Total time: %d seconds." % (
146 "Initialization" if session.is_initialization else "Upgrade",
147 ceil((datetime.utcnow() - start_time).total_seconds())
148 ))
149 else:
150 logger.error("Please check logs at %s" % log_path)
151
152 log_file.close()
153 sys.exit(statuscode)
0154
=== modified file 'anybox/recipe/openerp/server.py'
--- anybox/recipe/openerp/server.py 2013-09-08 17:19:27 +0000
+++ anybox/recipe/openerp/server.py 2014-02-06 07:42:46 +0000
@@ -2,6 +2,7 @@
2import os2import os
3from os.path import join3from os.path import join
4import sys4import sys
5import shutil
5import logging6import logging
6import subprocess7import subprocess
7import zc.buildout8import zc.buildout
@@ -46,13 +47,17 @@
46 soft_requirements = ('openerp-command',)47 soft_requirements = ('openerp-command',)
47 with_openerp_command = False48 with_openerp_command = False
48 with_gunicorn = False49 with_gunicorn = False
50 with_upgrade = True
49 ws = None51 ws = None
52 template_upgrade_script = os.path.join(os.path.dirname(__file__),
53 'upgrade.py.tmpl')
5054
51 def __init__(self, *a, **kw):55 def __init__(self, *a, **kw):
52 super(ServerRecipe, self).__init__(*a, **kw)56 super(ServerRecipe, self).__init__(*a, **kw)
53 opt = self.options57 opt = self.options
54 self.with_devtools = (58 self.with_devtools = (
55 opt.get('with_devtools', 'false').lower() == 'true')59 opt.get('with_devtools', 'false').lower() == 'true')
60 self.with_upgrade = self.options.get('upgrade_script') != ''
56 # discarding, because we have a special behaviour with custom61 # discarding, because we have a special behaviour with custom
57 # interpreters62 # interpreters
58 opt.pop('interpreter', None)63 opt.pop('interpreter', None)
@@ -186,6 +191,7 @@
186timeout = %(timeout)s191timeout = %(timeout)s
187max_requests = %(max_requests)s192max_requests = %(max_requests)s
188193
194openerp.multi_process = True # needed even with only one worker
189openerp.conf.server_wide_modules = ['web']195openerp.conf.server_wide_modules = ['web']
190conf = openerp.tools.config196conf = openerp.tools.config
191""" % gunicorn_options197""" % gunicorn_options
@@ -339,6 +345,29 @@
339 self.major_version),345 self.major_version),
340 )346 )
341347
348 def _register_upgrade_script(self, qualified_name):
349 desc = self._get_or_create_script('openerp_upgrader',
350 name=qualified_name)[1]
351 script_opt = self.options.get('upgrade_script', 'upgrade.py run')
352 script = script_opt.split()
353 if len(script) != 2:
354 # TODO add console script entry point support
355 raise zc.buildout.UserError(
356 ("upgrade_script option must take the form "
357 "SOURCE_FILE CALLABLE (got '%r')" % script))
358 script_source_path = self.make_absolute(script[0])
359 desc.update(
360 entry='openerp_upgrader',
361 arguments='%r, %r, %r, %r' % (
362 script_source_path, script[1],
363 self.config_path, self.buildout_dir),
364 )
365
366 if not os.path.exists(script_source_path):
367 logger.warning("Ugrade script source %s does not exist."
368 "Initializing it for you", script_source_path)
369 shutil.copy(self.template_upgrade_script, script_source_path)
370
342 def _register_gunicorn_startup_script(self, qualified_name):371 def _register_gunicorn_startup_script(self, qualified_name):
343 """Register a gunicorn foreground start script for installation.372 """Register a gunicorn foreground start script for installation.
344373
@@ -448,8 +477,10 @@
448477
449 initialization = os.linesep.join((478 initialization = os.linesep.join((
450 "",479 "",
451 "from anybox.recipe.openerp.startup import Session",480 "from anybox.recipe.openerp.runtime.session import Session",
452 "session = Session(%s)" % self._relativitize(self.config_path),481 "session = Session(%s, %r)" % (
482 self._relativitize(self.config_path),
483 self.buildout_dir),
453 "if len(sys.argv) <= 1:",484 "if len(sys.argv) <= 1:",
454 " print('To start the OpenERP working session, just do:')",485 " print('To start the OpenERP working session, just do:')",
455 " print(' session.open(db=DATABASE_NAME)')",486 " print(' session.open(db=DATABASE_NAME)')",
@@ -488,8 +519,9 @@
488519
489 common_init = os.linesep.join((520 common_init = os.linesep.join((
490 "",521 "",
491 "from anybox.recipe.openerp.startup import Session",522 "from anybox.recipe.openerp.runtime.session import Session",
492 "session = Session(%r)" % self.config_path,523 "session = Session(%r, %r)" % (self.config_path,
524 self.buildout_dir),
493 ))525 ))
494526
495 for script_name, desc in self.openerp_scripts.items():527 for script_name, desc in self.openerp_scripts.items():
@@ -518,9 +550,15 @@
518550
519 # provide additional needed entry points for main start/test scripts551 # provide additional needed entry points for main start/test scripts
520 self.eggs_reqs.extend((552 self.eggs_reqs.extend((
521 ('openerp_starter', 'anybox.recipe.openerp.start_openerp', 'main'),553 ('openerp_starter',
522 ('openerp_cron_worker', 'anybox.recipe.openerp.start_openerp',554 'anybox.recipe.openerp.runtime.start_openerp',
523 'main'),555 'main'),
556 ('openerp_cron_worker',
557 'anybox.recipe.openerp.runtime.start_openerp',
558 'main'),
559 ('openerp_upgrader',
560 'anybox.recipe.openerp.runtime.upgrade',
561 'upgrade'),
524 ))562 ))
525563
526 if self.major_version >= (8, 0):564 if self.major_version >= (8, 0):
@@ -551,6 +589,11 @@
551 'cron_worker_%s' % self.name)589 'cron_worker_%s' % self.name)
552 self._register_cron_worker_startup_script(qualified_name)590 self._register_cron_worker_startup_script(qualified_name)
553591
592 if self.with_upgrade:
593 qualified_name = self.options.get('upgrade_script_name',
594 'upgrade_%s' % self.name)
595 self._register_upgrade_script(qualified_name)
596
554 self._install_openerp_scripts()597 self._install_openerp_scripts()
555598
556 def _60_fix_root_path(self):599 def _60_fix_root_path(self):
557600
=== modified file 'anybox/recipe/openerp/tests/test_server.py'
--- anybox/recipe/openerp/tests/test_server.py 2013-08-25 06:31:14 +0000
+++ anybox/recipe/openerp/tests/test_server.py 2014-02-06 07:42:46 +0000
@@ -251,8 +251,8 @@
251 self.recipe.retrieve_addons()251 self.recipe.retrieve_addons()
252 paths = self.recipe.addons_paths252 paths = self.recipe.addons_paths
253 self.recipe.finalize_addons_paths(check_existence=False)253 self.recipe.finalize_addons_paths(check_existence=False)
254 self.assertEquals(paths, [addons_dir,254 self.assertEquals(paths, [os.path.join(oerp_dir, 'openerp', 'addons'),
255 os.path.join(oerp_dir, 'openerp', 'addons')])255 addons_dir])
256256
257 def test_retrieve_fixup_addons_local_60_check_ok(self):257 def test_retrieve_fixup_addons_local_60_check_ok(self):
258 oerp_dir = os.path.join(TEST_DIR, 'oerp60')258 oerp_dir = os.path.join(TEST_DIR, 'oerp60')
@@ -268,7 +268,7 @@
268 os.mkdir(addons_dir)268 os.mkdir(addons_dir)
269 self.recipe.finalize_addons_paths()269 self.recipe.finalize_addons_paths()
270 paths = self.recipe.addons_paths270 paths = self.recipe.addons_paths
271 self.assertEqual(paths, [addons_dir, root_dir])271 self.assertEqual(paths, [root_dir, addons_dir])
272 self.assertEqual(self.recipe.options['options.root_path'],272 self.assertEqual(self.recipe.options['options.root_path'],
273 os.path.join(oerp_dir, 'bin'))273 os.path.join(oerp_dir, 'bin'))
274274
275275
=== added file 'anybox/recipe/openerp/tests/test_utils.py'
--- anybox/recipe/openerp/tests/test_utils.py 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/tests/test_utils.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,25 @@
1import unittest
2import tempfile
3import shutil
4import os
5
6from ..utils import working_directory_keeper
7
8
9class WorkingDirectoryTestCase(unittest.TestCase):
10
11 def setUp(self):
12 self.dirpath = tempfile.mkdtemp()
13
14 def tearDown(self):
15 shutil.rmtree(self.dirpath)
16
17 def test_ctx_manager(self):
18 # warning: if this fails, then many other tests can be
19 # affected, because many don't like being in /
20 current = os.getcwd()
21 with working_directory_keeper:
22 os.chdir(self.dirpath)
23 self.assertNotEqual(os.getcwd(), current)
24
25 self.assertEqual(os.getcwd(), current)
026
=== added file 'anybox/recipe/openerp/upgrade.py.tmpl'
--- anybox/recipe/openerp/upgrade.py.tmpl 1970-01-01 00:00:00 +0000
+++ anybox/recipe/openerp/upgrade.py.tmpl 2014-02-06 07:42:46 +0000
@@ -0,0 +1,19 @@
1# -*- python -*-
2"""This is a template upgrade script.
3
4The purpose is both to cover the most common use-case (updating all modules)
5and to provide an example of how this works.
6"""
7
8
9def run(session, logger):
10 """Update all modules."""
11 if session.is_initialization:
12 logger.warn("Usage of upgrade script for initialization detected. "
13 "You should consider customizing the present upgrade "
14 "script to add modules install commands. The present "
15 "script is at : %s (byte-compiled form)",
16 __file__)
17 return
18 logger.info("Default upgrade procedure : updating all modules.")
19 session.update_modules(['all'])
020
=== modified file 'anybox/recipe/openerp/utils.py'
--- anybox/recipe/openerp/utils.py 2013-08-27 09:29:47 +0000
+++ anybox/recipe/openerp/utils.py 2014-02-06 07:42:46 +0000
@@ -7,6 +7,9 @@
7logger = logging.getLogger(__name__)7logger = logging.getLogger(__name__)
88
99
10MAJOR_VERSION_RE = re.compile(r'(\d+)[.](\d*)(\w*)')
11
12
10class WorkingDirectoryKeeper(object):13class WorkingDirectoryKeeper(object):
11 """A context manager to get back the working directory as it was before.14 """A context manager to get back the working directory as it was before.
1215
@@ -43,11 +46,6 @@
43 yield f46 yield f
4447
4548
46NIGHTLY_VERSION_RE = re.compile(r'(\d+)[.](\d+)-(\d+-\d+)$')
47
48MAJOR_VERSION_RE = re.compile(r'(\d+)[.](\d+)')
49
50
51def major_version(version_string):49def major_version(version_string):
52 """The least common denominator of OpenERP versions : two numbers.50 """The least common denominator of OpenERP versions : two numbers.
5351
@@ -55,14 +53,43 @@
55 releases, bzr versions etc. It's almost impossible to compare them without53 releases, bzr versions etc. It's almost impossible to compare them without
56 an a priori knowledge of release dates and revisions.54 an a priori knowledge of release dates and revisions.
5755
56 Here are some examples::
57
58 >>> major_version('1.2.3-foo.bar')
59 (1, 2)
60 >>> major_version('6.1-20121003-233130')
61 (6, 1)
62 >>> major_version('7.0alpha')
63 (7, 0)
64
58 Beware, the packaging script does funny things, such as labeling current65 Beware, the packaging script does funny things, such as labeling current
59 nightlies as 6.2-date-time whereas version_info is (7, 0, 0, ALPHA)66 nightlies as 6.2-date-time whereas version_info is (7, 0, 0, ALPHA)
60 We can in recipe code check for >= (6, 2), that's not a big issue.67 We can in recipe code check for >= (6, 2), that's not a big issue.
68
69 Regarding OpenERP saas releases (e.g. 7.saas~1) that are short-lived stable
70 versions between two "X.0" LTS releases, the second version number does not
71 contain a numeric value. The value X.5 will be returned (e.g. 7.5)::
72
73 >>> major_version('7.saas~1')
74 (7, 5)
75
61 """76 """
6277
63 m = MAJOR_VERSION_RE.match(version_string)78 m = MAJOR_VERSION_RE.match(version_string)
64 if m is not None:79
65 return tuple(int(m.group(i)) for i in (1, 2))80 if m is None:
81 raise ValueError("Unparseable version string: %r" % version_string)
82
83 major = int(m.group(1))
84 minor = m.group(2)
85 if not minor and m.group(3).startswith('saas'):
86 return major, 5
87
88 try:
89 return major, int(minor)
90 except TypeError:
91 raise ValueError(
92 "Unrecognized second version segment in %r" % version_string)
6693
6794
68def mkdirp(path):95def mkdirp(path):
6996
=== modified file 'anybox/recipe/openerp/vcs/bzr.py'
--- anybox/recipe/openerp/vcs/bzr.py 2013-09-06 12:14:37 +0000
+++ anybox/recipe/openerp/vcs/bzr.py 2014-02-06 07:42:46 +0000
@@ -213,7 +213,13 @@
213213
214 self.update_conf()214 self.update_conf()
215215
216 init_opt = self.options.get('bzr-init')
216 if self.is_fixed_revision(revision):217 if self.is_fixed_revision(revision):
218 if (offline and init_opt == 'lightweight-checkout'):
219 logger.warning("Offline mode, no update for lightweight "
220 "checkout at %s on revision %r",
221 self.target_dir, revision)
222 return
217 try:223 try:
218 self._update(revision)224 self._update(revision)
219 return225 return
@@ -225,8 +231,9 @@
225 logger.info("Offline mode, no pull for revision %r", revision)231 logger.info("Offline mode, no pull for revision %r", revision)
226 else:232 else:
227 self._pull()233 self._pull()
228 if not (offline and234
229 self.options.get('bzr-init') == 'stacked-branch'):235 if not (offline and init_opt in ('stacked-branch',
236 'lightweight-checkout')):
230 self._update(revision)237 self._update(revision)
231238
232 def _branch(self, revision):239 def _branch(self, revision):
233240
=== modified file 'anybox/recipe/openerp/vcs/git.py'
--- anybox/recipe/openerp/vcs/git.py 2013-09-06 16:21:36 +0000
+++ anybox/recipe/openerp/vcs/git.py 2014-02-06 07:42:46 +0000
@@ -82,7 +82,8 @@
8282
83 def archive(self, target_path):83 def archive(self, target_path):
84 revision = self.parents()[0]84 revision = self.parents()[0]
85 os.makedirs(target_path)85 if not os.path.exists(target_path):
86 os.makedirs(target_path)
86 with working_directory_keeper:87 with working_directory_keeper:
87 os.chdir(self.target_dir)88 os.chdir(self.target_dir)
88 target_tar = tempfile.NamedTemporaryFile(89 target_tar = tempfile.NamedTemporaryFile(
8990
=== modified file 'anybox/recipe/openerp/vcs/tests/test_bzr.py'
--- anybox/recipe/openerp/vcs/tests/test_bzr.py 2013-09-06 12:14:37 +0000
+++ anybox/recipe/openerp/vcs/tests/test_bzr.py 2014-02-06 07:42:46 +0000
@@ -332,18 +332,20 @@
332332
333class BzrOfflineTestCase(BzrBaseTestCase):333class BzrOfflineTestCase(BzrBaseTestCase):
334334
335 def make_local_branch(self, path, initial_rev):335 def make_local_branch(self, path, initial_rev, options=None):
336 """Make a local branch of the source at initial_rev and forbid pulls.336 """Make a local branch of the source at initial_rev and forbid pulls.
337 """337 """
338 if options is None:
339 options = {}
338 target_dir = os.path.join(self.dst_dir, path)340 target_dir = os.path.join(self.dst_dir, path)
339 # initial branching (non offline341 # initial branching (non offline
340 BzrBranch(target_dir, self.src_repo)(initial_rev)342 BzrBranch(target_dir, self.src_repo)(initial_rev)
341343
342 # crippled offline branch344 # crippled offline branch
343 branch = BzrBranch(target_dir, self.src_repo, offline=True)345 branch = BzrBranch(target_dir, self.src_repo, offline=True, **options)
344346
345 def _pull():347 def _pull():
346 raise UpdateError("Should not pull !")348 self.fail("Should not pull !")
347349
348 branch._pull = _pull350 branch._pull = _pull
349 return branch351 return branch
@@ -373,3 +375,31 @@
373 revid = branch.get_revid('1')375 revid = branch.get_revid('1')
374 branch('revid:' + revid)376 branch('revid:' + revid)
375 self.assertRevision1(branch)377 self.assertRevision1(branch)
378
379 def test_lightweight_checkout_noupdate(self):
380 """[offline mode] lightweight checkouts shall not be updated."""
381 branch = self.make_local_branch(
382 "clone to update", '1',
383 options={'bzr-init': 'lightweight-checkout'})
384
385 def _update(*a, **kw):
386 self.fail("Should not update !")
387
388 branch._update = _update
389
390 branch('last:1')
391 self.assertRevision1(branch)
392
393 def test_lightweight_checkout_noupdate_fixed_rev(self):
394 """[offline mode] lightweight checkouts shall not be updated."""
395 branch = self.make_local_branch(
396 "clone to update", 'last:1',
397 options={'bzr-init': 'lightweight-checkout'})
398
399 def _update(*a, **kw):
400 self.fail("Should not update !")
401
402 branch._update = _update
403
404 branch('1')
405 self.assertRevision2(branch)
376406
=== modified file 'anybox/recipe/openerp/vcs/tests/test_git.py'
--- anybox/recipe/openerp/vcs/tests/test_git.py 2013-09-06 16:21:36 +0000
+++ anybox/recipe/openerp/vcs/tests/test_git.py 2014-02-06 07:42:46 +0000
@@ -120,6 +120,9 @@
120 repo(new_sha)120 repo(new_sha)
121 self.assertEqual(repo.parents(), [new_sha])121 self.assertEqual(repo.parents(), [new_sha])
122122
123 # see launchpad #1215873
124 repo(new_sha)
125
123 def test_uncommitted_changes(self):126 def test_uncommitted_changes(self):
124 """GitRepo can detect uncommitted changes."""127 """GitRepo can detect uncommitted changes."""
125 # initial cloning128 # initial cloning
126129
=== modified file 'buildbot/MANIFEST.cfg'
--- buildbot/MANIFEST.cfg 2013-09-07 12:04:02 +0000
+++ buildbot/MANIFEST.cfg 2014-02-06 07:42:46 +0000
@@ -1,35 +1,57 @@
1[anybox.recipe.openerp]1[anybox.recipe.openerp]
2watch = bzr lp:anybox.recipe.openerp2watch = bzr lp:anybox.recipe.openerp
33
4[anybox.recipe.openerp-stable]
5watch = bzr lp:anybox.recipe.openerp/1.7
6
4[recipe-50]7[recipe-50]
5# A buildout to test latest version of the recipe in OpenERP 6.0 case8# A buildout to test latest version of the recipe in OpenERP 5.0 case
6# sale_margin is in extras and requires sale9# sale_margin is in extras and requires sale
7buildout = standalone recipe-50.cfg10buildout = bzr lp:anybox.recipe.openerp recipe-50.cfg subdir=buildbot
8openerp-addons = sale_margin11openerp-addons = sale_margin
9build-for = postgresql == 8.4 OR == 9.212build-for = postgresql == 8.4 OR == 9.2
10watch = bzr lp:anybox.recipe.openerp13build-category = mature
14# OpenERP v5 won't work on python 2.7
15build-requires = python == 2.6
16
17[stable-recipe-50]
18# A buildout to test latest version of the recipe in OpenERP 5.0 case
19# sale_margin is in extras and requires sale
20buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-50.cfg subdir=buildbot
21openerp-addons = sale_margin
22build-for = postgresql == 8.4 OR == 9.2
11build-category = mature23build-category = mature
12# OpenERP v5 won't work on python 2.724# OpenERP v5 won't work on python 2.7
13build-requires = python == 2.625build-requires = python == 2.6
1426
15[recipe-60]27[recipe-60]
16buildout = standalone recipe-60.cfg28buildout = bzr lp:anybox.recipe.openerp recipe-60.cfg subdir=buildbot
17bootstrap-version = 1.729bootstrap-version = 1.7
18build-for = postgresql == 8.430build-for = postgresql == 8.4
19watch = bzr lp:anybox.recipe.openerp31build-category = mature
32
33[stable-recipe-60]
34buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-60.cfg subdir=buildbot
35bootstrap-version = 1.7
36build-for = postgresql == 8.4
20build-category = mature37build-category = mature
2138
22[recipe-61]39[recipe-61]
23# A buildout to test latest version of the recipe in OpenERP 6.1 case40# A buildout to test latest version of the recipe in OpenERP 6.1 case
24buildout = standalone recipe-61.cfg41buildout = bzr lp:anybox.recipe.openerp recipe-61.cfg subdir=buildbot
25build-for = postgresql == 9.142build-for = postgresql == 9.1
26watch = bzr lp:anybox.recipe.openerp43build-category = mature
44
45[stable-recipe-61]
46# A buildout to test latest stable version of the recipe in OpenERP 6.1 case
47buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-61.cfg subdir=buildbot
48build-for = postgresql == 9.1
27build-category = mature49build-category = mature
2850
29[recipe-60-custom]51[recipe-60-custom]
30# A buildout to test latest version of the recipe in an OpenERP 6.0 custom case52# A buildout to test latest version of the recipe in an OpenERP 6.0 custom case
31# (stock server, bzr addons)53# (stock server, bzr addons)
32buildout = standalone recipe-60.cfg54buildout = bzr lp:anybox.recipe.openerp/trunk recipe-60.cfg subdir=buildbot
33build-for = postgresql == 8.455build-for = postgresql == 8.4
34watch = bzr lp:anybox.recipe.openerp56watch = bzr lp:anybox.recipe.openerp
35build-category = mature57build-category = mature
@@ -37,39 +59,46 @@
37[recipe-61-custom]59[recipe-61-custom]
38# A buildout to test latest version of the recipe in OpenERP 6.1 custom case60# A buildout to test latest version of the recipe in OpenERP 6.1 custom case
39# (bzr server and addons)61# (bzr server and addons)
40buildout = standalone recipe-61.cfg62buildout = bzr lp:anybox.recipe.openerp/trunk recipe-61.cfg subdir=buildbot
41build-for = postgresql == 9.163build-for = postgresql == 9.1
42watch = bzr lp:anybox.recipe.openerp64watch = bzr lp:anybox.recipe.openerp
43build-category = mature65build-category = mature
4466
45[stable-recipe-7.0]67[stable-recipe-7.0]
46# A buildout to test latest stable revision of the recipe on OpenERP 7.068# A buildout to test latest stable revision of the recipe on OpenERP 7.0
47buildout = standalone stable-recipe-7.0.cfg69buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-7.0.cfg subdir=buildbot
48build-for = postgresql >= 9.170build-for = postgresql >= 9.1
49watch = bzr lp:anybox.recipe.openerp
5071
51[recipe-7.0]72[recipe-7.0]
52# A buildout to test latest revision of the recipe on OpenERP 7.073# A buildout to test latest revision of the recipe on OpenERP 7.0
53buildout = standalone recipe-7.0.cfg74buildout = bzr lp:anybox.recipe.openerp/trunk recipe-7.0.cfg subdir=buildbot
54build-for = postgresql == 9.275build-for = postgresql == 9.2
55watch = bzr lp:anybox.recipe.openerp76post-buildout-steps = nose
77 test-openerp
78nose.tests = anybox.recipe.openerp/tests_with_openerp --logging-level=INFO
5679
57[recipe-trunk]80[recipe-trunk]
58# A buildout to test latest version of the recipe in OpenERP trunk81# A buildout to test latest version of the recipe in OpenERP trunk
59buildout = standalone recipe-trunk.cfg82buildout = bzr lp:anybox.recipe.openerp/trunk recipe-trunk.cfg subdir=buildbot
60build-for = postgresql >= 9.183build-for = postgresql > 9.2
61watch = bzr lp:anybox.recipe.openerp
6284
63[recipe-61-nightly]85[recipe-61-nightly]
64# A buildout to test latest version of the recipe for OpenERP nightly build86# A buildout to test a latest revision of the recipe on an
65buildout = standalone recipe-nightly.cfg87# OpenERP nightly build
66build-for = postgresql == 9.188buildout = bzr lp:anybox.recipe.openerp recipe-nightly.cfg subdir=buildbot
67watch = bzr lp:anybox.recipe.openerp89build-for = postgresql == 9.1
90build-category = experimental
91
92[stable-recipe-61-nightly]
93# A buildout to test latest stable revision of the recipe on an
94# OpenERP nightly build
95buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-nightly.cfg subdir=buildbot
96build-for = postgresql == 9.1
68build-category = experimental97build-category = experimental
6998
70[recipe-61-latest]99[recipe-61-latest]
71# A buildout to test latest version of the recipe for OpenERP nightly build100# A buildout to test latest version of the recipe for OpenERP nightly build
72buildout = standalone recipe-latest.cfg101buildout = bzr lp:anybox.recipe.openerp recipe-latest.cfg subdir=buildbot
73build-for = postgresql == 9.1102build-for = postgresql == 9.1
74watch = bzr lp:anybox.recipe.openerp103watch = bzr lp:anybox.recipe.openerp
75build-category = experimental104build-category = experimental
76105
=== added file 'buildbot/base_recipe.cfg'
--- buildbot/base_recipe.cfg 1970-01-01 00:00:00 +0000
+++ buildbot/base_recipe.cfg 2014-02-06 07:42:46 +0000
@@ -0,0 +1,24 @@
1[buildout]
2parts = openerp
3find-links = http://download.gna.org/pychart/
4versions = versions
5extensions = gp.vcsdevelop
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
8vcs-update = True
9
10[openerp]
11recipe = anybox.recipe.openerp:server
12options.xmlrpc = False
13options.xmlrpcs = False
14options.netrpc = False
15eggs = nose
16openerp_scripts = nosetests=nosetests command-line-options=-d
17
18[webclient]
19recipe = anybox.recipe.openerp:webclient
20version = 6.1-1
21
22[gtkclient]
23recipe = anybox.recipe.openerp:gtkclient
24version = nightly 6.1 latest
025
=== modified file 'buildbot/recipe-50.cfg'
--- buildbot/recipe-50.cfg 2013-08-04 10:35:20 +0000
+++ buildbot/recipe-50.cfg 2014-02-06 07:42:46 +0000
@@ -1,31 +1,14 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3
4versions = versions
5find-links = http://download.gna.org/pychart/
6
7extensions = gp.vcsdevelop
8vcs-extend-develop =
9 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
10vcs-update = True
113
12[openerp]4[openerp]
13recipe = anybox.recipe.openerp:server
14version = bzr lp:openobject-server/5.0 openerp-5.0 last:15version = bzr lp:openobject-server/5.0 openerp-5.0 last:1
15addons = bzr lp:openobject-addons/5.0 addons-5.0 last:16addons = bzr lp:openobject-addons/5.0 addons-5.0 last:1
16 bzr lp:openobject-addons/extra-5.0 addons-5.0-extra last:1 bzr-init=stacked-branch7 bzr lp:openobject-addons/extra-5.0 addons-5.0-extra last:1 bzr-init=stacked-branch
17
18eggs = formencode8eggs = formencode
19 pydns9 pydns
2010
21options.xmlrpc = False
22options.netrpc = True
23options.xmlrpcs = False
24xmlrpc_port = False
25xmlrpcs_port = False
26
27[gtkclient]11[gtkclient]
28recipe = anybox.recipe.openerp:gtkclient
29version = 5.0.1612version = 5.0.16
30eggs = pytz13eggs = pytz
3114
3215
=== modified file 'buildbot/recipe-60-custom.cfg'
--- buildbot/recipe-60-custom.cfg 2013-08-02 15:52:01 +0000
+++ buildbot/recipe-60-custom.cfg 2014-02-06 07:42:46 +0000
@@ -1,12 +1,13 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3extensions = gp.vcsdevelop 3
4vcs-extend-develop =4[openerp]
5 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp5version = 6.0.3
6vcs-update = True6addons = bzr lp:~anybox/openobject-addons/6.0.3-bugfix addons-6.0 last:1
77eggs =
8versions = versions8 formencode
9find-links = http://download.gna.org/pychart/9 pydns
10
1011
11[versions]12[versions]
12Babel = 0.9.613Babel = 0.9.6
@@ -40,13 +41,3 @@
40zc.buildout = 1.5.241zc.buildout = 1.5.2
41zc.recipe.egg = 1.3.242zc.recipe.egg = 1.3.2
4243
43[openerp]
44recipe = anybox.recipe.openerp:server
45eggs =
46 formencode
47 pydns
48
49version = 6.0.3
50addons = bzr lp:~anybox/openobject-addons/6.0.3-bugfix addons-6.0 last:1
51clean = true
52
5344
=== modified file 'buildbot/recipe-60.cfg'
--- buildbot/recipe-60.cfg 2013-08-02 16:20:41 +0000
+++ buildbot/recipe-60.cfg 2014-02-06 07:42:46 +0000
@@ -1,22 +1,13 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3extensions = gp.vcsdevelop3
4versions = versions
5find-links = http://download.gna.org/pychart/
6#vcs-extend-develop =
7# bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
8#vcs-update = True
9develop = /home/gracinet/openerp/recipe/anybox.recipe.openerp
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server
12version = 6.0.45version = 6.0.4
136
14[webclient]7[webclient]
15recipe = anybox.recipe.openerp:server
16version = 6.0.48version = 6.0.4
179
18[gtkclient]10[gtkclient]
19recipe = anybox.recipe.openerp:gtkclient
20version = 6.0.411version = 6.0.4
2112
22[versions]13[versions]
2314
=== modified file 'buildbot/recipe-61-custom.cfg'
--- buildbot/recipe-61-custom.cfg 2013-08-02 15:52:01 +0000
+++ buildbot/recipe-61-custom.cfg 2014-02-06 07:42:46 +0000
@@ -1,21 +1,11 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3find-links = http://download.gna.org/pychart/
4versions = versions
5extensions = gp.vcsdevelop
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
8vcs-update = True
93
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server5# TODO what is exactly custom here ?
12version = bzr lp:openobject-server/6.1 openerp-6.1 last:16version = bzr lp:openobject-server/6.1 openerp-6.1 last:1
13addons = bzr lp:openobject-addons/6.1 addons-6.1 last:17addons = bzr lp:openobject-addons/6.1 addons-6.1 last:1
14 bzr lp:openerp-web/6.1 addons-web last:1 subdir=addons8 bzr lp:openerp-web/6.1 addons-web last:1 subdir=addons
15clean = true
16options.xmlrpc = False
17options.xmlrpcs = False
18options.netrpc = False
199
20[versions]10[versions]
21babel = 0.9.611babel = 0.9.6
2212
=== modified file 'buildbot/recipe-61.cfg'
--- buildbot/recipe-61.cfg 2013-08-02 16:20:41 +0000
+++ buildbot/recipe-61.cfg 2014-02-06 07:42:46 +0000
@@ -1,22 +1,13 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3extensions = gp.vcsdevelop
4versions = versions
5find-links = http://download.gna.org/pychart/
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
8vcs-update = True
93
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server
12version = 6.1-15version = 6.1-1
136
14[webclient]7[webclient]
15recipe = anybox.recipe.openerp:server
16version = 6.1-18version = 6.1-1
179
18[gtkclient]10[gtkclient]
19recipe = anybox.recipe.openerp:gtkclient
20version = 6.1-111version = 6.1-1
2112
22[versions]13[versions]
2314
=== modified file 'buildbot/recipe-7.0.cfg'
--- buildbot/recipe-7.0.cfg 2013-08-02 16:20:41 +0000
+++ buildbot/recipe-7.0.cfg 2014-02-06 07:42:46 +0000
@@ -1,21 +1,10 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3find-links = http://download.gna.org/pychart/
4versions = versions
5extensions = gp.vcsdevelop
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
8vcs-update = True
93
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server
12version = bzr lp:openobject-server/7.0 openerp-7.0 last:15version = bzr lp:openobject-server/7.0 openerp-7.0 last:1
13addons = bzr lp:openobject-addons/7.0 addons-7.0 last:16addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1
14 bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons7 bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons
15clean = true
16options.xmlrpc = False
17options.xmlrpcs = False
18options.netrpc = False
198
20[versions]9[versions]
21babel = 0.9.610babel = 0.9.6
2211
=== modified file 'buildbot/recipe-latest.cfg'
--- buildbot/recipe-latest.cfg 2013-08-02 16:20:41 +0000
+++ buildbot/recipe-latest.cfg 2014-02-06 07:42:46 +0000
@@ -1,22 +1,13 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3extensions = gp.vcsdevelop
4versions = versions
5find-links = http://download.gna.org/pychart/
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
8vcs-update = True
93
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server5version = nightly 6.1 latest
12version = nightly 6.1 20120217-003606
136
14[webclient]7[webclient]
15recipe = anybox.recipe.openerp:server
16version = 6.1-18version = 6.1-1
179
18[gtkclient]10[gtkclient]
19recipe = anybox.recipe.openerp:gtkclient
20version = nightly 6.1 latest11version = nightly 6.1 latest
2112
22[versions]13[versions]
2314
=== modified file 'buildbot/recipe-nightly.cfg'
--- buildbot/recipe-nightly.cfg 2013-08-02 16:20:41 +0000
+++ buildbot/recipe-nightly.cfg 2014-02-06 07:42:46 +0000
@@ -1,22 +1,13 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3extensions = gp.vcsdevelop
4versions = versions
5find-links = http://download.gna.org/pychart/
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb
8vcs-update = True
93
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server
12version = nightly 6.1 20120217-0036065version = nightly 6.1 20120217-003606
136
14[webclient]7[webclient]
15recipe = anybox.recipe.openerp:server
16version = 6.1-18version = 6.1-1
179
18[gtkclient]10[gtkclient]
19recipe = anybox.recipe.openerp:gtkclient
20version = nightly 6.1 20120229-23035111version = nightly 6.1 20120229-230351
2112
22[versions]13[versions]
2314
=== modified file 'buildbot/recipe-trunk.cfg'
--- buildbot/recipe-trunk.cfg 2013-08-02 15:52:01 +0000
+++ buildbot/recipe-trunk.cfg 2014-02-06 07:42:46 +0000
@@ -1,21 +1,11 @@
1[buildout]1[buildout]
2parts = openerp2extends = base_recipe.cfg
3find-links = http://download.gna.org/pychart/
4versions = versions
5extensions = gp.vcsdevelop
6vcs-extend-develop =
7 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
8vcs-update = True
93
10[openerp]4[openerp]
11recipe = anybox.recipe.openerp:server5recipe = anybox.recipe.openerp:server
12version = bzr lp:openobject-server openerp-trunk last:16version = bzr lp:openobject-server openerp-trunk last:1
13addons = bzr lp:openobject-addons addons-trunk last:17addons = bzr lp:openobject-addons addons-trunk last:1
14 bzr lp:openerp-web addons-web-trunk last:1 subdir=addons8 bzr lp:openerp-web addons-web-trunk last:1 subdir=addons
15clean = true
16options.xmlrpc = False
17options.xmlrpcs = False
18options.netrpc = False
199
20[versions]10[versions]
21babel = 0.9.611babel = 0.9.6
2212
=== added file 'buildbot/stable-recipe-50.cfg'
--- buildbot/stable-recipe-50.cfg 1970-01-01 00:00:00 +0000
+++ buildbot/stable-recipe-50.cfg 2014-02-06 07:42:46 +0000
@@ -0,0 +1,4 @@
1[buildout]
2extends=recipe-50.cfg
3vcs-extend-develop =
4 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
05
=== added file 'buildbot/stable-recipe-60.cfg'
--- buildbot/stable-recipe-60.cfg 1970-01-01 00:00:00 +0000
+++ buildbot/stable-recipe-60.cfg 2014-02-06 07:42:46 +0000
@@ -0,0 +1,4 @@
1[buildout]
2extends = recipe-60.cfg
3vcs-extend-develop =
4 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
05
=== added file 'buildbot/stable-recipe-61.cfg'
--- buildbot/stable-recipe-61.cfg 1970-01-01 00:00:00 +0000
+++ buildbot/stable-recipe-61.cfg 2014-02-06 07:42:46 +0000
@@ -0,0 +1,4 @@
1[buildout]
2extends = recipe-61.cfg
3vcs-extend-develop =
4 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
05
=== added file 'buildbot/stable-recipe-7.0.cfg'
--- buildbot/stable-recipe-7.0.cfg 1970-01-01 00:00:00 +0000
+++ buildbot/stable-recipe-7.0.cfg 2014-02-06 07:42:46 +0000
@@ -0,0 +1,4 @@
1[buildout]
2extends = recipe-7.0.cfg
3vcs-extend-develop =
4 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anybox.recipe.openerp
05
=== removed file 'buildbot/stable-recipe-7.0.cfg'
--- buildbot/stable-recipe-7.0.cfg 2013-09-07 12:04:02 +0000
+++ buildbot/stable-recipe-7.0.cfg 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1[buildout]
2# A buildout to test the support branch for the latest major version of the
3# recipe
4parts = openerp
5find-links = http://download.gna.org/pychart/
6versions = versions
7extensions = gp.vcsdevelop
8vcs-extend-develop =
9 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anybox.recipe.openerp
10vcs-update = True
11
12[openerp]
13recipe = anybox.recipe.openerp:server
14version = bzr lp:openobject-server/7.0 openerp-7.0 last:1
15addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1
16 bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons
17clean = true
18options.xmlrpc = False
19options.xmlrpcs = False
20options.netrpc = False
21
22[versions]
23babel = 0.9.6
24PIL = 1.1.7
25pywebdav = 0.9.4.1
26PyXML = 0.8.4
27pyyaml = 3.10
28werkzeug = 0.8.3
29zsi = 2.0-rc3
30feedparser = 5.1.1
31gdata = 2.0.16
32lxml = 2.3.3
33psycopg2 = 2.4.4
34pydot = 1.0.28
35pyparsing = 1.5.6
36python-dateutil = 1.5
37python-ldap = 2.4.9
38python-openid = 2.2.5
39pytz = 2012b
40vatnumber = 1.0
41vobject = 0.8.1c
42xlwt = 0.7.3
430
=== added file 'buildbot/stable-recipe-nightly.cfg'
--- buildbot/stable-recipe-nightly.cfg 1970-01-01 00:00:00 +0000
+++ buildbot/stable-recipe-nightly.cfg 2014-02-06 07:42:46 +0000
@@ -0,0 +1,4 @@
1[buildout]
2extends = recipe-nightly.cfg
3vcs-extend-develop =
4 bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb
05
=== added directory 'doc'
=== added file 'doc/Makefile'
--- doc/Makefile 1970-01-01 00:00:00 +0000
+++ doc/Makefile 2014-02-06 07:42:46 +0000
@@ -0,0 +1,177 @@
1# Makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line.
5SPHINXOPTS =
6SPHINXBUILD = sphinx-build
7PAPER =
8BUILDDIR = sphinx_build
9
10# User-friendly check for sphinx-build
11ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13endif
14
15# Internal variables.
16PAPEROPT_a4 = -D latex_paper_size=a4
17PAPEROPT_letter = -D latex_paper_size=letter
18ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19# the i18n builder cannot share the environment and doctrees with the others
20I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21
22.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23
24help:
25 @echo "Please use \`make <target>' where <target> is one of"
26 @echo " html to make standalone HTML files"
27 @echo " dirhtml to make HTML files named index.html in directories"
28 @echo " singlehtml to make a single large HTML file"
29 @echo " pickle to make pickle files"
30 @echo " json to make JSON files"
31 @echo " htmlhelp to make HTML files and a HTML help project"
32 @echo " qthelp to make HTML files and a qthelp project"
33 @echo " devhelp to make HTML files and a Devhelp project"
34 @echo " epub to make an epub"
35 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36 @echo " latexpdf to make LaTeX files and run them through pdflatex"
37 @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38 @echo " text to make text files"
39 @echo " man to make manual pages"
40 @echo " texinfo to make Texinfo files"
41 @echo " info to make Texinfo files and run them through makeinfo"
42 @echo " gettext to make PO message catalogs"
43 @echo " changes to make an overview of all changed/added/deprecated items"
44 @echo " xml to make Docutils-native XML files"
45 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46 @echo " linkcheck to check all external links for integrity"
47 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48
49clean:
50 rm -rf $(BUILDDIR)/*
51
52html:
53 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54 @echo
55 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56
57dirhtml:
58 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59 @echo
60 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61
62singlehtml:
63 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64 @echo
65 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66
67pickle:
68 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69 @echo
70 @echo "Build finished; now you can process the pickle files."
71
72json:
73 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74 @echo
75 @echo "Build finished; now you can process the JSON files."
76
77htmlhelp:
78 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79 @echo
80 @echo "Build finished; now you can run HTML Help Workshop with the" \
81 ".hhp project file in $(BUILDDIR)/htmlhelp."
82
83qthelp:
84 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85 @echo
86 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
87 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenERPbuildoutrecipe.qhcp"
89 @echo "To view the help file:"
90 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenERPbuildoutrecipe.qhc"
91
92devhelp:
93 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94 @echo
95 @echo "Build finished."
96 @echo "To view the help file:"
97 @echo "# mkdir -p $$HOME/.local/share/devhelp/OpenERPbuildoutrecipe"
98 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenERPbuildoutrecipe"
99 @echo "# devhelp"
100
101epub:
102 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103 @echo
104 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105
106latex:
107 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108 @echo
109 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110 @echo "Run \`make' in that directory to run these through (pdf)latex" \
111 "(use \`make latexpdf' here to do that automatically)."
112
113latexpdf:
114 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115 @echo "Running LaTeX files through pdflatex..."
116 $(MAKE) -C $(BUILDDIR)/latex all-pdf
117 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118
119latexpdfja:
120 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121 @echo "Running LaTeX files through platex and dvipdfmx..."
122 $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124
125text:
126 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127 @echo
128 @echo "Build finished. The text files are in $(BUILDDIR)/text."
129
130man:
131 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132 @echo
133 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134
135texinfo:
136 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137 @echo
138 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139 @echo "Run \`make' in that directory to run these through makeinfo" \
140 "(use \`make info' here to do that automatically)."
141
142info:
143 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144 @echo "Running Texinfo files through makeinfo..."
145 make -C $(BUILDDIR)/texinfo info
146 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147
148gettext:
149 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150 @echo
151 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152
153changes:
154 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155 @echo
156 @echo "The overview file is in $(BUILDDIR)/changes."
157
158linkcheck:
159 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160 @echo
161 @echo "Link check complete; look for any errors in the above output " \
162 "or in $(BUILDDIR)/linkcheck/output.txt."
163
164doctest:
165 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166 @echo "Testing of doctests in the sources finished, look at the " \
167 "results in $(BUILDDIR)/doctest/output.txt."
168
169xml:
170 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171 @echo
172 @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173
174pseudoxml:
175 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176 @echo
177 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
0178
=== added directory 'doc/apidoc'
=== added file 'doc/apidoc/anybox.recipe.openerp.rst'
--- doc/apidoc/anybox.recipe.openerp.rst 1970-01-01 00:00:00 +0000
+++ doc/apidoc/anybox.recipe.openerp.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,75 @@
1anybox.recipe.openerp Package
2=============================
3
4:mod:`anybox.recipe.openerp` Package
5------------------------------------
6
7.. automodule:: anybox.recipe.openerp
8 :members:
9 :undoc-members:
10 :show-inheritance:
11
12:mod:`base` Module
13------------------
14
15.. automodule:: anybox.recipe.openerp.base
16 :members:
17 :undoc-members:
18 :show-inheritance:
19
20:mod:`devtools` Module
21----------------------
22
23.. automodule:: anybox.recipe.openerp.devtools
24 :members:
25 :undoc-members:
26 :show-inheritance:
27
28:mod:`gtkclient` Module
29-----------------------
30
31.. automodule:: anybox.recipe.openerp.gtkclient
32 :members:
33 :undoc-members:
34 :show-inheritance:
35
36:mod:`server` Module
37--------------------
38
39.. automodule:: anybox.recipe.openerp.server
40 :members:
41 :undoc-members:
42 :show-inheritance:
43
44:mod:`testing` Module
45---------------------
46
47.. automodule:: anybox.recipe.openerp.testing
48 :members:
49 :undoc-members:
50 :show-inheritance:
51
52:mod:`utils` Module
53-------------------
54
55.. automodule:: anybox.recipe.openerp.utils
56 :members:
57 :undoc-members:
58 :show-inheritance:
59
60:mod:`webclient` Module
61-----------------------
62
63.. automodule:: anybox.recipe.openerp.webclient
64 :members:
65 :undoc-members:
66 :show-inheritance:
67
68Subpackages
69-----------
70
71.. toctree::
72
73 anybox.recipe.openerp.runtime
74 anybox.recipe.openerp.vcs
75
076
=== added file 'doc/apidoc/anybox.recipe.openerp.runtime.rst'
--- doc/apidoc/anybox.recipe.openerp.runtime.rst 1970-01-01 00:00:00 +0000
+++ doc/apidoc/anybox.recipe.openerp.runtime.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,50 @@
1runtime Subpackage
2==================
3
4:mod:`runtime` Package
5----------------------
6
7.. automodule:: anybox.recipe.openerp.runtime
8 :members:
9 :undoc-members:
10 :show-inheritance:
11
12:mod:`session` Module
13---------------------
14
15.. automodule:: anybox.recipe.openerp.runtime.session
16 :members:
17 :undoc-members:
18 :show-inheritance:
19
20:mod:`upgrade` Module
21---------------------
22
23.. automodule:: anybox.recipe.openerp.runtime.upgrade
24 :members:
25 :undoc-members:
26 :show-inheritance:
27
28:mod:`patch_openerp_v5` Module
29------------------------------
30
31.. automodule:: anybox.recipe.openerp.runtime.patch_openerp_v5
32 :members:
33 :undoc-members:
34 :show-inheritance:
35
36:mod:`start_openerp` Module
37---------------------------
38
39.. automodule:: anybox.recipe.openerp.runtime.start_openerp
40 :members:
41 :undoc-members:
42 :show-inheritance:
43
44:mod:`test_openerp` Module
45--------------------------
46
47.. automodule:: anybox.recipe.openerp.runtime.test_openerp
48 :members:
49 :undoc-members:
50 :show-inheritance:
051
=== added file 'doc/apidoc/anybox.recipe.openerp.vcs.rst'
--- doc/apidoc/anybox.recipe.openerp.vcs.rst 1970-01-01 00:00:00 +0000
+++ doc/apidoc/anybox.recipe.openerp.vcs.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,59 @@
1vcs Subpackage
2==============
3
4:mod:`vcs` Package
5------------------
6
7.. automodule:: anybox.recipe.openerp.vcs
8 :members:
9 :undoc-members:
10 :show-inheritance:
11
12:mod:`base` Module
13------------------
14
15.. automodule:: anybox.recipe.openerp.vcs.base
16 :members:
17 :undoc-members:
18 :show-inheritance:
19
20:mod:`bzr` Module
21-----------------
22
23.. automodule:: anybox.recipe.openerp.vcs.bzr
24 :members:
25 :undoc-members:
26 :show-inheritance:
27
28:mod:`git` Module
29-----------------
30
31.. automodule:: anybox.recipe.openerp.vcs.git
32 :members:
33 :undoc-members:
34 :show-inheritance:
35
36:mod:`hg` Module
37----------------
38
39.. automodule:: anybox.recipe.openerp.vcs.hg
40 :members:
41 :undoc-members:
42 :show-inheritance:
43
44:mod:`svn` Module
45-----------------
46
47.. automodule:: anybox.recipe.openerp.vcs.svn
48 :members:
49 :undoc-members:
50 :show-inheritance:
51
52:mod:`testing` Module
53---------------------
54
55.. automodule:: anybox.recipe.openerp.vcs.testing
56 :members:
57 :undoc-members:
58 :show-inheritance:
59
060
=== added file 'doc/conf.py'
--- doc/conf.py 1970-01-01 00:00:00 +0000
+++ doc/conf.py 2014-02-06 07:42:46 +0000
@@ -0,0 +1,247 @@
1# -*- coding: utf-8 -*-
2#
3# OpenERP buildout recipe documentation build configuration file, created by
4# sphinx-quickstart on Wed Jul 24 18:32:19 2013.
5#
6# This file is execfile()d with the current directory set to its containing dir.
7#
8# Note that not all possible configuration values are present in this
9# autogenerated file.
10#
11# All configuration values have a default; values that are commented out
12# serve to show the default.
13
14import sys, os
15
16# If extensions (or modules to document with autodoc) are in another directory,
17# add these directories to sys.path here. If the directory is relative to the
18# documentation root, use os.path.abspath to make it absolute, like shown here.
19sys.path.insert(0, os.path.abspath('..'))
20# -- General configuration -----------------------------------------------------
21
22# If your documentation needs a minimal Sphinx version, state it here.
23#needs_sphinx = '1.0'
24
25# Add any Sphinx extension module names here, as strings. They can be extensions
26# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
27extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.viewcode']
28
29# Add any paths that contain templates here, relative to this directory.
30templates_path = ['sphinx_templates']
31
32# The suffix of source filenames.
33source_suffix = '.rst'
34
35# The encoding of source files.
36#source_encoding = 'utf-8-sig'
37
38# The master toctree document.
39master_doc = 'index'
40
41# General information about the project.
42project = u'OpenERP buildout recipe'
43copyright = u'2011-2013, Anybox SAS'
44
45# The version info for the project you're documenting, acts as replacement for
46# |version| and |release|, also used in various other places throughout the
47# built documents.
48#
49# The short X.Y version.
50version = '1.8'
51# The full version, including alpha/beta/rc tags.
52release = '1.8.2-dev'
53
54# The language for content autogenerated by Sphinx. Refer to documentation
55# for a list of supported languages.
56#language = None
57
58# There are two options for replacing |today|: either, you set today to some
59# non-false value, then it is used:
60#today = ''
61# Else, today_fmt is used as the format for a strftime call.
62#today_fmt = '%B %d, %Y'
63
64# List of patterns, relative to source directory, that match files and
65# directories to ignore when looking for source files.
66exclude_patterns = ['sphinx_build']
67
68# The reST default role (used for this markup: `text`) to use for all documents.
69#default_role = None
70
71# If true, '()' will be appended to :func: etc. cross-reference text.
72#add_function_parentheses = True
73
74# If true, the current module name will be prepended to all description
75# unit titles (such as .. function::).
76add_module_names = True
77
78# If true, sectionauthor and moduleauthor directives will be shown in the
79# output. They are ignored by default.
80#show_authors = False
81
82# The name of the Pygments (syntax highlighting) style to use.
83pygments_style = 'sphinx'
84
85# A list of ignored prefixes for module index sorting.
86modindex_common_prefix = ['anybox.recipe.openerp.']
87
88# If true, keep warnings as "system message" paragraphs in the built documents.
89#keep_warnings = False
90
91
92# -- Options for HTML output ---------------------------------------------------
93
94# The theme to use for HTML and HTML Help pages. See the documentation for
95# a list of builtin themes.
96html_theme = 'default'
97
98# Theme options are theme-specific and customize the look and feel of a theme
99# further. For a list of options available for each theme, see the
100# documentation.
101#html_theme_options = {}
102
103# Add any paths that contain custom themes here, relative to this directory.
104#html_theme_path = []
105
106# The name for this set of Sphinx documents. If None, it defaults to
107# "<project> v<release> documentation".
108#html_title = None
109
110# A shorter title for the navigation bar. Default is the same as html_title.
111#html_short_title = None
112
113# The name of an image file (relative to this directory) to place at the top
114# of the sidebar.
115html_logo = 'sphinx_templates/logo.png'
116
117# The name of an image file (within the static path) to use as favicon of the
118# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
119# pixels large.
120html_favicon = 'sphinx_templates/favicon.ico'
121
122# Add any paths that contain custom static files (such as style sheets) here,
123# relative to this directory. They are copied after the builtin static files,
124# so a file named "default.css" will overwrite the builtin "default.css".
125html_static_path = ['sphinx_static']
126
127# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
128# using the given strftime format.
129#html_last_updated_fmt = '%b %d, %Y'
130
131# If true, SmartyPants will be used to convert quotes and dashes to
132# typographically correct entities.
133#html_use_smartypants = True
134
135# Custom sidebar templates, maps document names to template names.
136#html_sidebars = {}
137
138# Additional templates that should be rendered to pages, maps page names to
139# template names.
140#html_additional_pages = {}
141
142# If false, no module index is generated.
143#html_domain_indices = True
144
145# If false, no index is generated.
146#html_use_index = True
147
148# If true, the index is split into individual pages for each letter.
149#html_split_index = False
150
151# If true, links to the reST sources are added to the pages.
152#html_show_sourcelink = True
153
154# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
155#html_show_sphinx = True
156
157# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
158#html_show_copyright = True
159
160# If true, an OpenSearch description file will be output, and all pages will
161# contain a <link> tag referring to it. The value of this option must be the
162# base URL from which the finished HTML is served.
163#html_use_opensearch = ''
164
165# This is the file name suffix for HTML files (e.g. ".xhtml").
166#html_file_suffix = None
167
168# Output file base name for HTML help builder.
169htmlhelp_basename = 'OpenERPbuildoutrecipedoc'
170
171
172# -- Options for LaTeX output --------------------------------------------------
173
174latex_elements = {
175# The paper size ('letterpaper' or 'a4paper').
176#'papersize': 'letterpaper',
177
178# The font size ('10pt', '11pt' or '12pt').
179#'pointsize': '10pt',
180
181# Additional stuff for the LaTeX preamble.
182#'preamble': '',
183}
184
185# Grouping the document tree into LaTeX files. List of tuples
186# (source start file, target name, title, author, documentclass [howto/manual]).
187latex_documents = [
188 ('index', 'OpenERPbuildoutrecipe.tex', u'OpenERP buildout recipe Documentation',
189 u'Christophe Combelles, Georges Racinet', 'manual'),
190]
191
192# The name of an image file (relative to this directory) to place at the top of
193# the title page.
194#latex_logo = None
195
196# For "manual" documents, if this is true, then toplevel headings are parts,
197# not chapters.
198#latex_use_parts = False
199
200# If true, show page references after internal links.
201#latex_show_pagerefs = False
202
203# If true, show URL addresses after external links.
204#latex_show_urls = False
205
206# Documents to append as an appendix to all manuals.
207#latex_appendices = []
208
209# If false, no module index is generated.
210#latex_domain_indices = True
211
212
213# -- Options for manual page output --------------------------------------------
214
215# One entry per manual page. List of tuples
216# (source start file, name, description, authors, manual section).
217man_pages = [
218 ('index', 'openerpbuildoutrecipe', u'OpenERP buildout recipe Documentation',
219 [u'Christophe Combelles, Georges Racinet'], 1)
220]
221
222# If true, show URL addresses after external links.
223#man_show_urls = False
224
225
226# -- Options for Texinfo output ------------------------------------------------
227
228# Grouping the document tree into Texinfo files. List of tuples
229# (source start file, target name, title, author,
230# dir menu entry, description, category)
231texinfo_documents = [
232 ('index', 'OpenERPbuildoutrecipe', u'OpenERP buildout recipe Documentation',
233 u'Christophe Combelles, Georges Racinet', 'OpenERPbuildoutrecipe', 'One line description of project.',
234 'Miscellaneous'),
235]
236
237# Documents to append as an appendix to all manuals.
238#texinfo_appendices = []
239
240# If false, no module index is generated.
241#texinfo_domain_indices = True
242
243# How to display URL addresses: 'footnote', 'no', or 'inline'.
244#texinfo_show_urls = 'footnote'
245
246# If true, do not generate a @detailmenu in the "Top" node's menu.
247#texinfo_no_detailmenu = False
0248
=== renamed file 'README.rst' => 'doc/configuration.rst'
--- README.rst 2013-09-07 11:43:18 +0000
+++ doc/configuration.rst 2014-02-06 07:42:46 +0000
@@ -1,5 +1,5 @@
1anybox.recipe.openerp1Configuration reference
2=====================2=======================
33
4This is a `Buildout <https://github.com/buildout/buildout>`_ recipe that can4This is a `Buildout <https://github.com/buildout/buildout>`_ recipe that can
5download, install and configure one or several OpenERP servers, web clients,5download, install and configure one or several OpenERP servers, web clients,
@@ -8,8 +8,6 @@
8with gunicorn deployment and an additional cron worker. It works under Linux8with gunicorn deployment and an additional cron worker. It works under Linux
9and MacOs. It might work under Windows but it is untested.9and MacOs. It might work under Windows but it is untested.
1010
11For a **quickstart** you can jump to the howto_ section.
12
13A "Buildout recipe" is the engine behind a Buildout "part". A "buildout part"11A "Buildout recipe" is the engine behind a Buildout "part". A "buildout part"
14is a part of a larger application built with the Buildout sandbox build system.12is a part of a larger application built with the Buildout sandbox build system.
15Using Buildout is harmless for your system because it is entirely13Using Buildout is harmless for your system because it is entirely
@@ -17,120 +15,167 @@
17buildout is gone. You never have to use administrative rights, except for15buildout is gone. You never have to use administrative rights, except for
18build dependencies.16build dependencies.
1917
20.. contents::18.. _buildout_conf_parts:
2119
22Recipes20The buildout configuration file and parts
23~~~~~~~21~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2422The intents of this section is to highlights a few facts that we've
25You get 3 recipes at once. The recipe to use is the following:23found especially useful. People should refer to the
2624`reference zc.buildout documentation
27For the server::25<https://pypi.python.org/pypi/zc.buildout/2.2.1>`_
26and in particular to the `configuration file syntax
27<https://pypi.python.org/pypi/zc.buildout/2.2.1#configuration-file-syntax>`_
28(these links may have to be adapted for the version in use).
29
30
31Buildout configuration files are written almost in INI format, and
32always start with a ``buildout`` section::
33
34 [buildout]
35 parts = openerp
36
37The ``parts`` option specifies which parts to install by default if
38one runs ``bin/buildout`` with no explicit ``install`` directive.
39
40Parts directly correspond to sections of the configuration file, and
41must specify the recipe that's to be used::
42
43 [openerp]
44 recipe = anybox.recipe.openerp:server
45
46An extra dependency of the recipe gets required at runtime like this::
47
48 recipe = anybox.recipe.openerp[bzr]:server
49
50Command line
51------------
52The configuration file can be specified from the command line::
53
54 bin/buildout -c buildout.local.cfg
55
56Recipe options can be overridden from the command-line::
57
58 bin/buildout -c buildout.local.cfg openerp:clean=True openerp:xmlrpc_port=8169
59
60Parts that are not listed in the ``buildout`` configuration section
61can be explicitely installed::
62
63 bin/buildout install openerp funkload static-analysis
64
65.. _extends:
66
67Inheritance
68-----------
69
70A buildout configuration file can reference another one and change
71some options (note the ``+=`` notation that's not part of the INI format)::
72
73 [buildout]
74 extends = buildout.base.cfg
75
76 [openerp]
77 eggs += nose
78 coverage
79 with_devtools = True
80
81These extensions can be chained. This allows in particular project maintainers
82to separate the configuration options that are considered to be part
83of the project from those that depend on the server environment
84(ports, database hosts…)
85
86Default configuration
87---------------------
88
89If available, the settings from ``$HOME/.buildout/default.cfg`` always
90apply, as if it where the default value of the :ref:`extends <extends>` option.
91
92This is commonly used with the ``eggs-directory`` and
93:ref:`openerp-downloads-directory` options, because these amount to create a
94user-level cache.
95
96Finally, you may also use :ref:`extends <extends>` in ``default.cfg`` to point
97to a system-wide configuration file (useful to enforce
98policies at the organization or physical site level, such as local
99index servers, mirrors, etc.).
100
101
102OpenERP recipes
103~~~~~~~~~~~~~~~
104
105There are three different recipes bundled with
106``anybox.recipe.openerp``. The option line to put in your part (see
107:ref:`buildout_conf_parts`) is the following.
108
109Server
110------
111::
28112
29 recipe = anybox.recipe.openerp:server113 recipe = anybox.recipe.openerp:server
30114
31For the web client::115.. note:: If you plan on using Launchpad's short Bazaar branch notation
116 (``lp:``), then you need to add the ``bzr`` extra-dependency::
117
118 recipe = anybox.recipe.openerp[bzr]:server
119
120Web client
121----------
122::
32123
33 recipe = anybox.recipe.openerp:webclient124 recipe = anybox.recipe.openerp:webclient
34125
35For the gtk client::126GTK client
127----------
128::
36129
37 recipe = anybox.recipe.openerp:gtkclient130 recipe = anybox.recipe.openerp:gtkclient
38131
39Default options from zc.recipe.egg132.. note:: from OpenERP 7.0 onwards, the web and gtk clients aren't
40~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~133 that useful anymore.
41134
42This recipe reuses the *zc.recipe.egg:scripts* recipe, so the options135Options for assembly and source management
43are the same (*eggs*, *interpreter*, etc.), and some changes, documented below.136~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44137
45Consult the documentation here http://pypi.python.org/pypi/zc.recipe.egg138.. _version:
46
47The main useful ones are below:
48
49eggs
50----
51
52Starting from version 0.16 of the recipe, you don't need to put anything in
53this option by default. But you may specify additional eggs needed by addons,
54or just useful ones::
55
56 eggs =
57 ipython
58 openobject-library
59
60scripts
61-------
62.. note:: for scripts needing to call OpenERP internal API or to load
63 an OpenERP database prior to execution, check
64 ``openerp_scripts`` below.
65
66The behaviour of this option is slightly modified :
67by default, no script other than those directly related to OpenERP are
68generated, but you may specify some explicitely, with the same semantics as the
69normal behaviour (we simply set an empty default value, which means to not
70produce scripts)::
71
72 scripts =
73 change_tz
74
75In the current state, beware to *not* require the same script in different
76parts or rename them. See
77https://bugs.launchpad.net/anybox.recipe.openerp/+bug/1020967 for
78details.
79
80interpreter
81-----------
82With the ``gtklcient`` and ``webclient`` recipes,
83this is the default `interpreter` option of `zc.recipe.egg` that
84specifies the name of the Python interpreter that shoud be included in
85the``bin`` directory of the buildout::
86
87 interpreter = erp_python
88
89With the ``server`` recipe, the ``interpreter`` option will be ignored,
90because it always creates an interpreter with preloaded objects to
91bootstrap openerp. Check the ``interpreter_name`` option below for
92more details.
93
94
95Specific options
96~~~~~~~~~~~~~~~~
97
98The recipe also adds a few specific options:
99139
100version140version
101-------141-------
102142
103Specifies the OpenERP version to use. It can be:143Specifies the OpenERP version to use. It can be:
104144
105The **version number** of an official OpenERP (server, web client or gtk client)::145* The **version number** of an official OpenERP (server, web client or gtk client)::
106146
107 version = 6.0.3147 version = 6.0.3
108148
109A **custom download**::149* A **custom download**::
110150
111 version = url http://example.com/openerp.tar.gz151 version = url http://example.com/openerp.tar.gz
112152
113An absolute or a relative **path**::153* An absolute or a relative **path**::
114154
115 version = path /my/path/to/a/custom/openerp155 version = path /my/path/to/a/custom/openerp
116156
117A custom **bzr, hg, git or svn** branch or repository. The syntax is the same157* A custom **bzr, hg, git or svn** branch or repository. The syntax is the same
118as the `addons` option (see below)::158 as with the :ref:`addons` option::
119159
120 version = bzr lp:openobject-server/6.1 openerp61 last:1160 recipe = anybox.recipe.openerp[bzr]:server
121161 version = bzr lp:openobject-server/6.1 openerp61 last:1
122A **nightly** build::162
123163 .. note:: the ``[bzr]`` extra dependency declaration is useful for
124 version = nightly 6.1 20120814-233345164 resolution of the ``lp:`` address shortcuts.
125165
126or (dangerously unpinned version)::166* A **nightly** build::
127167
128 version = nightly 6.1 latest168 version = nightly 6.1 20120814-233345
129169
130or even more dangerous::170* or (dangerously unpinned version)::
131171
132 version = nightly trunk latest172 version = nightly 6.1 latest
133173
174* or even more dangerous::
175
176 version = nightly trunk latest
177
178.. _addons:
134179
135addons180addons
136------181------
@@ -139,6 +184,7 @@
139184
140Example::185Example::
141186
187 recipe = anybox.recipe.openerp[bzr]:server
142 addons = local ../some/relative/path/for/custom_addons/188 addons = local ../some/relative/path/for/custom_addons/
143 local /some/other/absolute/path/for/custom_addons189 local /some/other/absolute/path/for/custom_addons
144 bzr lp:openobject-addons/trunk/ addons0 last:1190 bzr lp:openobject-addons/trunk/ addons0 last:1
@@ -151,6 +197,10 @@
151addons, or a single addon. In that latter case, it will be actually197addons, or a single addon. In that latter case, it will be actually
152placed one directory below.198placed one directory below.
153199
200.. note:: the ``[bzr]`` extra-dependency declaration as showcased
201 above in the ``recipe`` line is necessary for
202 resolution of ``lp:`` launchpad address shortcuts.
203
154.. warning::204.. warning::
155205
156 Never name one of these addons directory simply ``addons``. It206 Never name one of these addons directory simply ``addons``. It
@@ -159,15 +209,17 @@
159209
160For remote repositories, the syntax is:210For remote repositories, the syntax is:
161211
162``TYPE URL DESTINATION REVISION [OPTIONS]``212 ``TYPE URL DESTINATION REVISION [OPTIONS]``
163213
164* *TYPE* can be ``bzr``, ``hg``, ``git`` or ``svn``214with the following semantics:
165* *URL* is any URL scheme supported by the versionning tool215
166* *DESTINATION* is the local directory that will be created (relative or absolute)216:TYPE: one of ``bzr``, ``hg``, ``git`` or ``svn``
167* *REVISION* is any version specification supported (revision, tag, etc.)217:URL: is any URL scheme supported by the versionning tool
168* *OPTIONS* take the form ``name=value``. Currently the ``subdir``218:DESTINATION: is the local directory that will be created (relative or absolute)
169 option is recognized. If used, the given subdirectory of the219:REVISION: is any version specification supported (revision, tag, etc.)
170 repository is registered as an addons directory.220:OPTIONS: each one takes the form ``name=value``. No whitespace is
221 allowed inside an option, and no escaping is
222 implemented.
171223
172Repositories are updated on each build according to the specified224Repositories are updated on each build according to the specified
173revision. You must be careful with the revision specification.225revision. You must be careful with the revision specification.
@@ -176,32 +228,59 @@
176specified revision is performed, if the VCS allows it (Subversion does228specified revision is performed, if the VCS allows it (Subversion does
177not).229not).
178230
179.. note:: An additional option is supported for bzr. **'bzr-init'**231The ``subdir`` addons option
180 defines the way the bzr branch232````````````````````````````
181 is initialized for addons or server declared with a bzr233
182 repository path.234The ``subdir`` option, if used, makes the recipe use the given
183235subdirectory of the repository as the addons directory.
184 Possible values:236A very common example is the line for standard web addons from bzr::
185237
186 branch (default)238 bzr lp:openerp-web/7.0 openerp-web last:1 subdir=addons
187 Working copy initialized with the command239
188 ``bzr branch url ...``240The ``bzr-init`` addons option
189 stacked-branch241``````````````````````````````
190 Working copy initialized with the command242**'bzr-init'** defines the way the bzr branch
191 ``bzr branch --stacked url ...``243is initialized for addons or server declared with a bzr
192244repository path.
193 lightweight-checkout245
194 Working copy initialized with the command246.. note:: new in version 1.7.0
195 ``bzr checkout --lightweight url ...``247
248Possible values:
249
250:branch (default): Working copy initialized with the command
251 ``bzr branch url ...``
252
253:stacked-branch: Working copy initialized with the command
254 ``bzr branch --stacked url ...``
255:lightweight-checkout: Working copy initialized with the command
256 ``bzr checkout --lightweight url ...``
257
258.. _eggs:
259
260eggs
261----
262This option behaves like the identically named one of the most common
263`zc.recipe.egg <https://pypi.python.org/pypi/zc.recipe.egg>`_.
264
265Starting from version 0.16 of the recipe, you don't need to put anything in
266this option by default: the recipe is supposed to add all needed
267dependencies for OpenERP by itself, but you have to specify additional
268eggs needed by addons, or just useful ones::
269
270 eggs = ipython
271 python-ldap
272 openobject-library
273
274.. _revisions:
196275
197revisions276revisions
198---------277---------
199278
200This option allows to further precise what has been specified through279This option allows to further precise what has been specified through
201the ``addons`` and ``version`` options by fixing VCS revisions.280the :ref:`addons` and :ref:`version` options by fixing VCS revisions.
202281
203The main use-case it to apply it in an extension buildout282The main use-case it to apply it in an :ref:`extension buildout
204configuration file::283configuration file <extends>`::
205284
206 [buildout]285 [buildout]
207 extends = base.cfg286 extends = base.cfg
@@ -211,7 +290,7 @@
211 addons-openerp 7109290 addons-openerp 7109
212291
213As you can see in that example, the first token is the target292As you can see in that example, the first token is the target
214filesystem path, as in the ``addons`` option, the second one is the293filesystem path, as in the :ref:`addons` option, the second one is the
215revision, except in the case of the main software (if VCS based), for294revision, except in the case of the main software (if VCS based), for
216which there's no filesystem path.295which there's no filesystem path.
217296
@@ -223,278 +302,196 @@
223* freezing satisfactory revisions in a release process (the recipe can302* freezing satisfactory revisions in a release process (the recipe can
224 do that automatically for you, see ``freeze-to`` option below).303 do that automatically for you, see ``freeze-to`` option below).
225304
305.. _clean:
306
226clean307clean
227-----308-----
228309
229If set to true, this option will clean remove python object files from310If set to true, this option will clean remove python object files from
230the main server part and addons before any update or install.311the main server part and addons before any update or install, and
312perform relevant VCS idea of "clean, purge".
313
314.. warning:: developers can lose their uncommitted work with this option.
315
316 This option is not meant for developer setups, rather for
317 deployment and continuous integration. To avoid making a
318 dedicated buildout configuration for you CI bot, just add
319 it on the command-line.
231320
232Note that tarball downloads get re-extracted afresh in any case.321Note that tarball downloads get re-extracted afresh in any case.
233322
234openerp_scripts323.. _openerp_options:
235---------------324
236325OpenERP options
237Introduction and use-cases326~~~~~~~~~~~~~~~
238``````````````````````````327
239This option lets you install console scripts provided by any of the loaded eggs,328With the OpenERP buildout recipes, OpenERP options are managed
240so that they can access to OpenERP internals and load databases.329directly from the buildout file (usually
241Some interesting use-cases:330``buildout.cfg``) from the part.
242331
243* specific batch jobs332The OpenERP configuration files are generated by OpenERP itself in the directory
244* introspection tools333specified by ``etc-directory``, which defaults to the `etc` directory under your
245* general-purposes test launchers that don't have any knowledge of334buildout directory.
246 OpenERP specifics335
247* actually, the main startup scripts themselves (with a default336The settings of the OpenERP configuration files are specified using a
248 configuration, of course)337dotted notation in which the fist segment is the name of the
249338corresponding section of the OpenERP config file and the second is the
250Usage339option name.
251`````340
252This multiline option is similar to the classical ``scripts`` options341The specified options will just overwrite the existing
253of ``zc.recipe.eggs:scripts``. It lets you ask for installation of342options in the corresponding config files. You don't have to replicate all the
254console scripts provided by the various Python distribution involved343options in your section of the buildout file. If a setting or a section does
255in the buildout part (including OpenERP itself).344not natively exist in the openerp config file, it can be created from there for
256345your application.
257The built console scripts can import all the involved Python346
258distributions, and have access to a ``session`` object, to issue347For example you can specify the xmlrpc port for the server or
259OpenERP native calls (see348even an additional option that does not exist in the default config file::
260``interpreter_name`` option below for details on how to use it).349
261350 options.xmlrpc_port = 8069
262One has to register exactly one console script per line.351 options.additional_option = "foobar"
263352
264As it is the case with ``scripts``, one actually specifies the name of the353It will end-up in the server configuration as::
265entry point to use (we are all used to that entry point being the name354
266of the resulting script, because that's what ``setup.py install`` does).355 [options]
267356 xmlrpc_port = 8069
268Suppose there is a distribution ``my.package`` with the following lines in357 additional_option = "foobar"
269its ``setup.py``::358
270359For the web client you can specify the port and company url with::
271 entry_points="""360
272361 global.server.socket_port = 8080
273 [console_scripts]362 openerp-web.company.url = 'http://anybox.fr'
274 my = my.package.main:run363
275 """364It will modify the corresponding web client config::
276365
277Now the following configuration extract builds a script called366 [global]
278``my_openerp1``, that can access ``session``::367 server.socket_port = 8080
279368
280 [openerp1]369 [openerp-web]
281 (...)370 company.url = 'http://anybox.fr'
282 openerp_scripts = my371
283372.. note:: Buildout :ref:`configuration inheritance <extends>` is
284To control the script name, just do, e.g,::373 especially useful to manage the separation between a
285374 reusable buildout configuration and local settings.
286 [openerp1]375
287 (...)376.. note:: Note that for security reasons, the superadmin password is not set by
288 openerp_scripts = my=my_script377 default. If you want databases to be manageable through the UI,
289378 you may either explicitely set that password in the buildout part
290This will build it as ``bin/my_script``.379 configuration or even set it temporarily in the
291380 ``etc/openerp.conf`` file.
292Command-line options and test launchers381
293```````````````````````````````````````382
294383Options for executables generation and serving
295If ``my.package`` is meant to do OpenERP heavy-lifting, then surely it384~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
296will provide a powerful command-line parsing. e.g., to let the end user chose385
297the database on which to work, etc.386.. _script_name:
298
299Sometimes, however, the script itself has no knowledge of OpenERP at
300all, but still must run after a database has been fully initialized.
301The main use case for this is test launchers, such as
302`nose <https://nose.readthedocs.org/en/latest/>`_ or simply ``unit2``.
303For these, the recipe has a facility to rewrap the script and add some further
304command-line options.
305
306In this example, we build ``unit2``, the launcher that comes with
307``unittest2``, and wrap it to add the database option::
308
309 [openerp]
310 (...)
311 openerp_scripts = unit2 command-line-options=-d
312
313You may then run it this way::
314
315 bin/unit2_openerp -d unit-tests-db -- discover some/addon
316
317Notice how ``--`` is used to separate the ``-d`` or
318any recipe-related options from the options expected by the script itself.
319
320If one wishes to run the tests with ``nose``, one has further to
321require it. In the following example, we also ask for the ``coverage``
322package::
323
324 [openerp]
325 (...)
326 eggs = nose
327 coverage
328 openerp_scripts = nosetests command-line-options=-d
329
330Here's our test run with coverage and pdb post-mortem::
331
332 bin/nosetests-openerp -d unit-tests-db -- --nologcapture \
333 --with-coverage --pdb \
334 some/addon/tests/test_one.py
335
336Main startup scripts
337````````````````````
338The recipe will in all cases build OpenERP startup scripts, according to other
339configuration options (gunicorn, tests etc.). These are
340actually special cases of the scripts controlled via ``openerp_scripts``.
341
342This allows you (for now) to control the names. For instance, to
343replace ``bin/start_openerp`` with ``bin/oerp``, just do::
344
345 [openerp]
346 (...)
347 openerp_scripts = openerp_starter=oerp
348
349Here's the list of currently available internal entry points. For
350these, the ``command-line-options`` modifier has no effect.
351
352:openerp_starter: main OpenERP startup script (dynamically added
353 behing the scenes by the recipe)
354:openerp_tester: uniform script to start OpenERP, launch all tests and
355 exit. This can be achieved with the main startup
356 scripts, but options differ among OpenERP versions.
357 (also dynamically added behind the scenes).
358:openerp_cron_worker: entry point for the cron worker script that gets
359 built for gunicorn setups.
360:oe: entry point declared by ``openerp-command`` and used by the recipe.
361:gunicorn: entry point declared by ``gunicorn`` and used by the recipe.
362387
363script_name388script_name
364-----------389-----------
365390
366.. warning:: as of version 1.7.0, this option is deprecated because of its391.. warning:: as of version 1.7.0, this option is deprecated because of its
367 redundancy with ``openerp_scripts``.392 redundancy with :ref:`openerp_scripts`.
368393
369OpenERP startup scripts are created in the `bin` directory. By default the name is:394OpenERP startup scripts are created in the `bin` directory. By default
370start_<part_name>, so you can have several startup scripts for each part if you395the name is ``start_<part_name>``, so you can have several startup
371configure several OpenERP servers or clients. You can pass additional typical396scripts for each part if you configure several OpenERP servers or clients.
397
398You can pass additional typical
372arguments to the server via the startup script, such as -i or -u options.399arguments to the server via the startup script, such as -i or -u options.
373400
374You can choose another name for the script by using the *script_name*401You can choose another name for the script by using the *script_name*
375option ::402option ::
376403
377 script_name = start_erp 404 script_name = start_erp
378405
379interpreter_name406
380----------------407.. _openerp_scripts:
381408
382The recipe will automatically create a python interpreter with a409openerp_scripts
383``session`` object that can bootstrap OpenERP with a database right410---------------
384away. You can use that for interactive sessions or to launch a script::411This option lets you install console scripts provided by any of the loaded eggs,
385412so that they can access to OpenERP internals and load databases.
386 $ bin/python_openerp413
387 To start the OpenERP working session, just do:414.. note:: new in version 1.7.0
388 session.open()415
389 or416Here we describe the format of the option only.
390 session.open(db=DATABASE_NAME)417For explanation about what it means and how to use it, please refer to
391 Then you can issue commands such as418:doc:`/scripts`.
392 session.registry('res.users').browse(session.cr, 1, 1)419
393420The option is multiline. Each line specifies exactly one
394 >>>421script, and must respect the following format:
395422
396The interpreter name is ``python_<part_name>`` by default; but it can423 ``ENTRY_POINT_NAME[=WISHED_SCRIPT_NAME] [MODIFIER [MODIFIER […]]]``
397be explicitely set like this::424
398425Each modifier takes the ``MODIFIER_NAME=MODIFIER_VALUE`` form.
399 interpreter_name = my_py426No whitespace is allowed in modifiers, entry point, nor produced script names.
400427
401If you want *not* to have the interpreter, juste do428Here's the list of currently available modifiers, with links inside :doc:`the
402429dedicated chapter about OpenERP scripts </scripts>`).
403 interpreter_name =430
404431:command-line-options: :ref:`command_line_options`
405The bootstrapping facility may also be used within a script installed432:arguments: :ref:`arguments_session`
406by an egg; just insert this in your code to get the session object as433
407if you were in the interpreter::434Full example::
408435
409 from anybox.recipe.openerp.startup import Session436 openerp_scripts = my_script arguments=session
410 session = Session()437 my_other_script=actual-script-name arguments=3,session
411438 nosetests=nosetests command-line-options=-d
412.. note:: this facility is new in version 1.6.0, and tested with439
413 OpenERP 7 only for now.440
414441.. _upgrade_script_name:
415startup_delay442
416-------------443upgrade_script_name
417444-------------------
418Specifies a delay in seconds to wait before actually launching OpenERP. This445
419option was a preliminary hack to support both gunicorn instance and a legacy446This option lets you specify the wished name for the upgrade script.
420instance. The Gunicorn startup script (see below) itself is not affected by447The default value is ``upgrade_<part_name>``.
421this setting ::448
422449.. note:: new in version 1.8.0.
423 startup_delay = 3450
424451 We are actually not sure to keep that option, since it's
425with_devtools452 redundant with :ref:`openerp_scripts`.
426-------------453
427Allows to load development and install useful devlopment and testing454
428tools, notably the following scripts:455.. _upgrade_script:
429456
430* ``test_openerp``: a uniform test launcher for all supported457upgrade_script
431 versions. See test_script_name option below for details.458--------------
432* ``openerp_command``: see openerp_command_name option below for459
433 details. Not installed for OpenERP major versions less than or equal to 6.1.460.. note:: new in version 1.8.0
434461
435This option is False by default, hence it's activated this way::462This option lets you specify a source (``.py``) file and a callable
436463defined in that file to perform database upgrades. The default value
437 with_devtools = true464is::
438465
439It will also add some dependencies that are typical to development466 upgrade_script = upgrade.py run
440setups (tests related packages etc.) and automatically load where467
441needed helpers, such as `anybox.testing.datetime468If the specified source file doest not exist, the recipe will
442<http://pypi.python.org/pypi/anybox.testing.datetime>`_ (allows to469initialize it with a simple and meaningful sample content, consistent
443cheat with system time).470with the default value above.
444471
445test_script_name472If you want *not* to have an upgrade script, just override this option
446----------------473with a blank value::
447.. warning:: as of version 1.7.0, this option is deprecated because of its474
448 redundancy with ``openerp_scripts``.475 upgrade_script =
449476
450If the ``with_devtools`` is set to True, the recipe will create a477See the full :ref:`upgrade_scripts` documentation to learn more
451test script, which is named by default ``test_<part_name>``. You may478about upgrade scripts.
452override the name in the configuration as in the following example::479
453480.. note:: new in version 1.8.0
454 test_script_name = test_erp481
455482
456The test script takes the same arguments as the regular startup483.. _gunicorn:
457script::
458
459 bin/test_openerp --help
460 bin/test_openerp -d test_db -i purchase,sale
461
462At the time of this writing, all this script does compared to the
463regular startup script is to bring uniformity across OpenERP versions
464by tweaking options internally.
465
466base_url
467--------
468
469URL from which to download official and nightly versions
470(assuming the archive filenames are constistent with those in
471OpenERP download server). This is a basic mirroring capability::
472
473 base_url = http://download.example.com/openerp/
474
475openerp-downloads-directory
476---------------------------
477
478Allows to share OpenERP downloads among several buildouts. You should put this
479option in your ``~/.buildout/default.cfg`` file. It specifies the destination
480download directory for OpenERP archives. The path may be absolute or relative
481to the buildout directory.
482
483Example::
484
485 [buildout]
486 openerp-downloads-directory = /home/user/.buildout/openerp-downloads
487484
488gunicorn485gunicorn
489--------486--------
490487
491Gunicorn integration is only supported on OpenERP >= 6.1.488Gunicorn integration is only supported on OpenERP ≥ 6.1.
492Any value of this option makes the recipe generate a script to start489Any value of this option makes the recipe generate a script to start
493OpenERP with Gunicorn and (*new in version 1.1*) a dedicated script to490OpenERP with Gunicorn and (*new in version 1.1*) a dedicated script to
494handle cron jobs.491handle cron jobs.
495492
496For OpenERP 6.1, the only accepted values are ``direct`` and493For OpenERP 6.1, the only accepted values are ``direct`` and
497``proxied``. Any value is suitable for OpenERP >= 7494``proxied``. Any value is suitable for OpenERP ≥ 7
498495
499Proxied mode496Proxied mode
500````````````497````````````
@@ -503,7 +500,7 @@
503500
504 gunicorn = proxied501 gunicorn = proxied
505502
506This behaviour has been kept for OpenERP >= 7 to keep503This behaviour has been kept for OpenERP ≥ 7 to keep
507backwards compatibility, but the option is now superseded by the504backwards compatibility, but the option is now superseded by the
508general ``proxy_mode`` option of the server. In the buildout context,505general ``proxy_mode`` option of the server. In the buildout context,
509that'd be::506that'd be::
@@ -552,25 +549,24 @@
552allows for graceful restarts (use this for minor changes only).549allows for graceful restarts (use this for minor changes only).
553550
554551
552.. _openerp_command_name:
553
555openerp_command_name554openerp_command_name
556--------------------555--------------------
557.. warning:: as of version 1.7.0, this option is deprecated, check556.. warning:: as of version 1.7.0, this option is deprecated because of
558 ``openerp_scripts`` for more details.557 its redundancy with :ref:`openerp_scripts`.
559558
560OpenERP Command Line Tools (openerp-command for short) is an559OpenERP Command Line Tools (openerp-command for short) is an
561alternative set of command-line tools that may someday subsede the560alternative set of command-line tools that may someday subsede the
562current monolithic startup script. Currently experimental, but561current monolithic startup script. Currently experimental, but
563already very useful in development mode.562already very useful in development mode.
564563
565It is currently enabled if the ``with_devtools`` option is on.564It is currently enabled if the :ref:`with_devtools` option is on.
566565
567This works by requiring the ``openerp-command`` python566This works by requiring the ``openerp-command`` python
568distribution, which is not on PyPI as of this writting. You may want567distribution, which is not on PyPI as of this writting, but comes
569to use the ``vcsdevelop`` extension to get it from Launchpad::568bundled with the current OpenERP trunk (believed to be the future
570569OpenERP 8).
571 [buildout]
572 extensions = gp.vcsdevelop
573 vcs-extend-develop = bzr+http://bazaar.launchpad.net/openerp/openerp-command#egg=openerp-command
574570
575As for other scripts, you can control its name of the produced script, e.g::571As for other scripts, you can control its name of the produced script, e.g::
576572
@@ -580,11 +576,226 @@
580``oe`` is the classical name for this script outside of the realm of576``oe`` is the classical name for this script outside of the realm of
581this buildout recipe.577this buildout recipe.
582578
579.. note:: ``openerp-command`` has first been introduced as a separate
580 project while OpenERP 7.0 was in development stage. People
581 wanting to use it with OpenERP 7.0 can still grab it from
582 Launchpad with the ``gp.vcsdevelop`` extension::
583
584 [buildout]
585 extensions = gp.vcsdevelop
586 vcs-extend-develop = bzr+http://bazaar.launchpad.net/openerp/openerp-command@419#egg=openerp-command
587
588 The latest Launchpad revision is actually the final removal,
589 done at the time where it's been included in
590 ``lp:openobject-server``.
591
592
583.. warning::593.. warning::
584594
585 Do not use to launch production servers, especially in an automatic595 On OpenERP 7, do not use to launch production servers, especially in
586 way, openerp-command is really unstable and that may damage your596 an automatic way, ``openerp-command`` is really unstable and that
587 installation.597 may damage your installation.
598
599
600
601scripts
602-------
603.. note:: This option is useful for general purpose scripts
604 only. For scripts related to OpenERP, see
605 :doc:`/scripts`, and the :ref:`openerp_scripts` option.
606
607This option controls the generation of console scripts declared by the
608various involved Python distributions (either directly required with
609the :ref:`eggs` option, or by dependency).
610
611By default, no such script is generated, but you may specify some
612according to your needs, with the same semantics as in ``zc.recipe.egg``.
613
614 scripts = change_tz
615
616In the current state, beware to *not* require the same script in different
617parts or rename them. See
618https://bugs.launchpad.net/anybox.recipe.openerp/+bug/1020967 for
619details.
620
621
622.. _startup_delay:
623
624startup_delay
625-------------
626
627Specifies a delay in seconds to wait before actually launching OpenERP. This
628option was a preliminary hack to support both gunicorn instance and a legacy
629instance. The Gunicorn startup script (see below) itself is not affected by
630this setting ::
631
632 startup_delay = 3
633
634Options for development, QA and introspection
635~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
636
637.. _with_devtools:
638
639with_devtools
640-------------
641Allows to load development and install useful devlopment and testing
642tools, notably the following scripts:
643
644* ``test_openerp``: a uniform test launcher for all supported
645 versions. See test_script_name option below for details.
646* ``openerp_command``: see openerp_command_name option below for
647 details. Not installed for OpenERP major versions less than or equal to 6.1.
648
649This option is False by default, hence it's activated this way::
650
651 with_devtools = true
652
653It will also add some dependencies that are typical to development
654setups (tests related packages etc.) and automatically load where
655needed helpers, such as `anybox.testing.datetime
656<http://pypi.python.org/pypi/anybox.testing.datetime>`_ (allows to
657cheat with system time).
658
659
660.. _test_script_name:
661
662test_script_name
663----------------
664.. warning:: as of version 1.7.0, this option is deprecated because of its
665 redundancy with :ref:`openerp_scripts`.
666
667If the ``with_devtools`` is set to True, the recipe will create a
668test script, which is named by default ``test_<part_name>``. You may
669override the name in the configuration as in the following example::
670
671 test_script_name = test_erp
672
673The test script takes the same arguments as the regular startup
674script::
675
676 bin/test_openerp --help
677 bin/test_openerp -d test_db -i purchase,sale
678
679At the time of this writing, all this script does compared to the
680regular startup script is to bring uniformity across OpenERP versions
681by tweaking options internally.
682
683*As of version 1.8.2*, the ``--install-all`` additional option will be
684expanded on-the-fly as ``-i`` on all available modules (don't confuse
685with ``-i all``: the latter is equivalent to ``-i base``).
686
687
688.. _interpreter_name:
689
690interpreter_name
691----------------
692
693The recipe will automatically create a python interpreter with a
694``session`` object that can bootstrap OpenERP with a database right
695away. You can use that for interactive sessions or to launch a script::
696
697 $ bin/python_openerp
698 To start the OpenERP working session, just do:
699 session.open()
700 or
701 session.open(db=DATABASE_NAME)
702 Then you can issue commands such as
703 session.registry('res.users').browse(session.cr, 1, 1)
704
705 >>>
706
707The interpreter name is ``python_<part_name>`` by default; but it can
708be explicitely set like this::
709
710 interpreter_name = my_py
711
712If you want *not* to have the interpreter, juste do
713
714 interpreter_name =
715
716If you want to wrap a python script with such session objects, read
717:doc:`/scripts` and especially :ref:`arguments_session`.
718See also :ref:`openerp_scripts`.
719
720.. note:: this facility is new in version 1.6.0, and tested with
721 OpenERP ≥ 6.1 only for now.
722
723
724interpreter
725-----------
726With the ``gtkclient`` and ``webclient`` recipes,
727this behauves like the `interpreter` option of `zc.recipe.egg`: it
728gives you a Python interpreter in the ``bin`` subdirectory of the buildout::
729
730 interpreter = erp_python
731
732With the ``server`` recipe, the ``interpreter`` option will be ignored,
733because this recipe always creates an interpreter with preloaded objects to
734bootstrap openerp, and these depend on the configuration.
735Check :ref:`interpreter_name` for more details.
736
737
738
739
740Options for download and caching strategies
741~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
742
743Let us start by listing a few global buildout options (to be put in
744the ``[buildout]`` section), whose scope is much larger than the
745OpenERP recipe.
746
747:eggs-directory: control where eggs are stored after download and/or
748 build and reciprocally acts as a cache.
749:index: specifies where to get informations about distributions not found in
750 ``eggs-directory``.
751:find-links: direct URLs to look for distributions
752:allow-hosts: white list of URL patterns allowed for distributions
753 download. Great to exclude the numerous useless sites
754 that setuptools may want to crawl and which tend to
755 break each time a new version gets referenced on PyPI.
756
757The OpenERP recipes define a few more.
758
759
760.. _base_url:
761
762base_url
763--------
764This option is local to the *part*.
765
766URL from which to download official and nightly versions
767(assuming the archive filenames are constistent with those in
768OpenERP download server). This is a basic mirroring capability::
769
770 base_url = http://download.example.com/openerp/
771
772
773.. _openerp-downloads-directory:
774
775openerp-downloads-directory
776---------------------------
777This is an option for the ``[buildout]`` section
778
779Allows to share OpenERP downloads among several buildouts. You should put this
780option in your ``~/.buildout/default.cfg`` file. It specifies the destination
781download directory for OpenERP archives. The path may be absolute or relative
782to the buildout directory.
783
784Example::
785
786 [buildout]
787 openerp-downloads-directory = /home/user/.buildout/openerp-downloads
788
789
790
791Options for release and packaging
792~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
793
794.. note:: release and packaging should be provided by dedicated
795 executables, not by options. These options should disappear
796 at some point between 1.8 and 1.9 versions.
797
798.. _freeze-to:
588799
589freeze-to800freeze-to
590---------801---------
@@ -613,7 +824,7 @@
613 bin/buildout -o openerp-server-1:freeze-to=frozen.cfg824 bin/buildout -o openerp-server-1:freeze-to=frozen.cfg
614825
615This produces a buildout configuration file named ``frozen.cfg``,826This produces a buildout configuration file named ``frozen.cfg``,
616with notably an ``openerp-server-1`` part having a ``revisions`` option that827with notably an ``openerp-server-1`` part having a :ref:`revisions` option that
617freezes everything.828freezes everything.
618829
619For configurations with several openerp related parts, you can freeze830For configurations with several openerp related parts, you can freeze
@@ -641,22 +852,25 @@
641.. warning:: currently ``freeze-to`` cannot fix eggs versions related852.. warning:: currently ``freeze-to`` cannot fix eggs versions related
642 to non-openerp parts.853 to non-openerp parts.
643854
855.. _freeze-allow-picked-versions:
856
644freeze-allow-picked-versions857freeze-allow-picked-versions
645----------------------------858----------------------------
646859
647This option is to be used in conjunction with ``freeze-to``. If set to860This option is to be used in conjunction with :ref:`freeze-to`. If set to
648``False``, it will add ``allow-picked-versions = false``861``False``, it will add ``allow-picked-versions = false``
649for ``zc.buildout`` versions that support this flag.862for ``zc.buildout`` versions that support this flag.
650863
651.. warning:: in the current state of things, this can cause problems864.. warning:: in the current state of things, this can cause problems
652 if you have non-openerp parts (see warning in ``freeze-to``865 if you have non-openerp parts (see the various warnings
653 documentation).866 in :ref:`freeze-to`)
654867
868.. _extract-downloads-to:
655869
656extract-downloads-to870extract-downloads-to
657--------------------871--------------------
658872
659Following the same kind of logic as ``freeze-to``, this option allows873Following the same kind of logic as :ref:`freeze-to`, this option allows
660to turn a buildout that aggregates from various remote sources874to turn a buildout that aggregates from various remote sources
661(tarball downloads, VCSes) into a self-contained buildout archive875(tarball downloads, VCSes) into a self-contained buildout archive
662directory that can be packed for easy distribution.876directory that can be packed for easy distribution.
@@ -685,8 +899,8 @@
685or further extended for system-dependent options such as port, db899or further extended for system-dependent options such as port, db
686connection, etc.900connection, etc.
687901
688The ``extract-downloads-to`` options can be used for several parts902The ``extract-downloads-to`` option can be used for several parts
689with the same target directory (same as ``freeze-to``).903with the same target directory (same as :ref:`freeze-to`).
690904
691Furthermore, a default ``freeze-to`` is issued, producing a buildout905Furthermore, a default ``freeze-to`` is issued, producing a buildout
692configuration called ``extracted_from.cfg`` in the target directory,906configuration called ``extracted_from.cfg`` in the target directory,
@@ -698,317 +912,3 @@
698same rules with respect to uncommitted changes.912same rules with respect to uncommitted changes.
699913
700Python distributions managed with ``gp.vcsdevelop`` are taken into account.914Python distributions managed with ``gp.vcsdevelop`` are taken into account.
701
702
703OpenERP options
704---------------
705
706You can define OpenERP options directly from the buildout file (usually
707``buildout.cfg``) in the recipe section.
708The OpenERP configuration files are generated by OpenERP itself in the directory
709specified by ``etc-directory`` which defaults to the `etc` directory under your
710buildout directory.
711The settings of the OpenERP configuration files can be controlled using a
712dotted notation prefixed by the name of the corresponding section of the
713OpenERP config file. The specified options will just overwrite the existing
714options in the corresponding config files. You don't have to replicate all the
715options in your section of the buildout file. If a setting or a section does
716not natively exist in the openerp config file, it can be created from there for
717your application.
718
719For example you can specify the xmlrpc port for the server or
720even an additional option that does not exist in the default config file::
721
722 options.xmlrpc_port = 8069
723 options.additional_option = "foobar"
724
725It will end-up in the server config as::
726
727 [options]
728 xmlrpc_port = 8069
729 additional_option = "foobar"
730
731For the web client you can specify the company url with::
732
733 global.server.socket_port = 8080
734 openerp-web.company.url = 'http://anybox.fr'
735
736It will modify the corresponding web client config::
737
738 [global]
739 server.socket_port = 8080
740
741 [openerp-web]
742 company.url = 'http://anybox.fr'
743
744
745.. note:: Note that for security reason, the superadmin password is not set by
746 default. If you want to create a database you should temporary set it manually
747 in the etc/openerp.conf file
748
749
750
751.. _howto:
752
753How to create and bootstrap a buildout
754~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
755
756To create a buildout and run the build, you just need **1 file** and **2 commands**:
757
758- Create a single ``buildout.cfg`` file.
759- Be sure you installed all your build dependencies
760- Bootstrap the buildout with: ``python bootstrap.py``
761- Run the build with: ``bin/buildout``
762
763The same with more details below :
764
765Creating the buildout
766---------------------
767
768Create a ``buildout.cfg`` file in an empty directory, containing the
769configuration of the `example 6.1`_ section.
770
771.. _dependencies:
772
773Installing build dependencies
774-----------------------------
775
776You basically need typical development tools needed to build all the Python
777dependency eggs of OpenERP. You can do this by yourself with your system or
778Linux distribution.
779
780Or if you're using a Debian system, we provide a single dependency package you
781can use to install all dependencies in one shot:
782
783Add the following line in your ``/etc/apt/sources.list``::
784
785 deb http://apt.anybox.fr/openerp common main
786
787Install the dependency package::
788
789 $ sudo aptitude update
790 $ sudo aptitude install openerp-server-system-build-deps
791
792You can uninstall this package with `aptitude` after the build to
793automatically remove all un-needed dependencies, but you need to
794install *run dependencies* before that ::
795
796 $ sudo aptitude install openerp-server-system-run-deps
797 $ sudo aptitude remove openerp-server-system-build-deps
798
799Please note that these package will have your system install the
800*client* part of PostgreSQL software only. If you want a
801PostgreSQL server on the same host, that's not in the recipe scope,
802just install it as well.
803
804Bootstrapping the buildout
805--------------------------
806
807Bootstrapping the buildout consists in creating the basic structure of the buildout, and installing buildout itself in the directory.
808
809The easiest and recommended way to bootstrap is to use a ``bootstrap.py`` script::
810
811 $ wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py
812 $ python bootstrap.py
813
814As an alternative and more complicated solution, you may also bootstrap by
815creating a virtualenv, installing zc.buildout, then run the bootstrap::
816
817 $ virtualenv sandbox
818 $ sandbox/bin/pip install zc.buildout
819 $ sandbox/bin/buildout bootstrap
820
821Running the build
822-----------------
823
824Just run ::
825
826 $ bin/buildout
827
828Starting OpenERP
829----------------
830
831Just run ::
832
833 $ bin/start_openerp
834
835
836.. _example 6.1:
837
838Example OpenERP 6.1 buildout
839~~~~~~~~~~~~~~~~~~~~~~~~~~~~
840
841Here is a very simple example for a latest OpenERP 6.1 nightly and a
842custom addon hosted on Bitbucket:
843
844::
845
846 [buildout]
847 parts = openerp
848 versions = versions
849 find-links = http://download.gna.org/pychart/
850
851 [openerp]
852 recipe = anybox.recipe.openerp:server
853 # replace '6.1' with 'trunk' to get a 7.0 current nightly:
854 version = nightly 6.1 latest
855 addons = hg https://bitbucket.org/anybox/anytracker addons-at default
856
857 [versions]
858 MarkupSafe = 0.15
859 Pillow = 1.7.7
860 PyXML = 0.8.4
861 babel = 0.9.6
862 feedparser = 5.1.1
863 gdata = 2.0.16
864 lxml = 2.3.3
865 mako = 0.6.2
866 psycopg2 = 2.4.4
867 pychart = 1.39
868 pydot = 1.0.28
869 pyparsing = 1.5.6
870 python-dateutil = 1.5
871 python-ldap = 2.4.9
872 python-openid = 2.2.5
873 pytz = 2012b
874 pywebdav = 0.9.4.1
875 pyyaml = 3.10
876 reportlab = 2.5
877 simplejson = 2.4.0
878 vatnumber = 1.0
879 vobject = 0.8.1c
880 werkzeug = 0.8.3
881 xlwt = 0.7.3
882 zc.buildout = 1.5.2
883 zc.recipe.egg = 1.3.2
884 zsi = 2.0-rc3
885
886
887.. note:: with OpenERP 6.1 the web client is natively included in the server as a
888 simple module. In that case you don't need to write a separate part for the web
889 client, unless that's what you really want to do.
890
891
892Example OpenERP 6.0 buildout
893~~~~~~~~~~~~~~~~~~~~~~~~~~~~
894
895Here is a sample buildout with version specification, 2 OpenERP servers (with
896one using the latest 6.0 branch on the launchpad) using only NETRPC and
897listening on 2 different ports, and 2 web clients::
898
899 [buildout]
900 parts = openerp1 web1 openerp2 web2
901 #allow-picked-versions = false
902 versions = versions
903 find-links = http://download.gna.org/pychart/
904
905 [openerp1]
906 recipe = anybox.recipe.openerp:server
907 version = 6.0.3
908 options.xmlrpc = False
909 options.xmlrpcs = False
910
911 [web1]
912 recipe = anybox.recipe.openerp:webclient
913 version = 6.0.3
914
915 [openerp2]
916 recipe = anybox.recipe.openerp:server
917 version = bzr lp:openobject-server/6.0 openobject-server-6.x last:1
918
919 options.xmlrpc = False
920 options.xmlrpcs = False
921 options.netrpc_port = 8170
922
923 [web2]
924 recipe = anybox.recipe.openerp:webclient
925 version = 6.0.3
926 global.openerp.server.port = '8170'
927 global.server.socket_port = 8180
928
929 [versions]
930 MarkupSafe = 0.15
931 Pillow = 1.7.7
932 anybox.recipe.openerp = 0.9
933 caldav = 0.1.10
934 collective.recipe.cmd = 0.5
935 coverage = 3.5
936 distribute = 0.6.25
937 feedparser = 5.0.1
938 lxml = 2.1.5
939 mako = 0.4.2
940 nose = 1.1.2
941 psycopg2 = 2.4.2
942 pychart = 1.39
943 pydot = 1.0.25
944 pyparsing = 1.5.6
945 python-dateutil = 1.5
946 pytz = 2012b
947 pywebdav = 0.9.4.1
948 pyyaml = 3.10
949 reportlab = 2.5
950 vobject = 0.8.1c
951 z3c.recipe.scripts = 1.0.1
952 zc.buildout = 1.5.2
953 zc.recipe.egg = 1.3.2
954 Babel = 0.9.6
955 FormEncode = 1.2.4
956 simplejson = 2.1.6
957
958
959Other sample buildouts
960~~~~~~~~~~~~~~~~~~~~~~
961
962Here are a few ready-to-use buildouts:
963
964(Be sure to install system dependencies_ first)
965
966OpenERP with the development branches of the Magento connector addons::
967
968 $ hg clone https://bitbucket.org/anybox/openerp_connect_magento_buildout
969 $ cd openerp_connect_magento_buildout
970 $ python bootstrap.py
971 $ bin/buildout
972 $ bin/start_openerp
973
974OpenERP with the development branches of the Prestashop connector addons::
975
976 $ hg clone https://bitbucket.org/anybox/openerp_connect_prestashop_buildout
977 $ cd openerp_connect_prestashop_buildout
978 $ python bootstrap.py
979 $ bin/buildout
980 $ bin/start_openerp
981
982Other examples are available in the ``buildbot`` subdirectory of the
983source distribution archive of this recipe (the ``tar.gz`` file that
984can be downloaded `from the PyPI
985<http://pypi.python.org/pypi/anybox.recipe.openerp>`_), and are
986continuously tested in the
987`anybox buildbot <http://buildbot.anybox.fr/>`_ which is powered by
988`anybox.buildbot.openerp <http://pypi.python.org/pypi/anybox.buildbot.openerp>`_.
989
990
991Contribute
992~~~~~~~~~~
993
994Authors:
995
996 * Christophe Combelles
997 * Georges Racinet
998
999Contributors:
1000
1001 * Jean-Sébastien Suzanne
1002 * Yannick Vaucher
1003 * Jacques-Etienne Baudoux
1004 * Laurent Mignon
1005 * Leonardo Pistone
1006
1007The primary branch is on the launchpad:
1008
1009 * Code repository and bug tracker: https://launchpad.net/anybox.recipe.openerp
1010 * PyPI page: http://pypi.python.org/pypi/anybox.recipe.openerp
1011
1012Please don't hesitate to give feedback and especially report bugs or
1013ask for new features through launchpad at this URL: https://bugs.launchpad.net/anybox.recipe.openerp/+bugs
1014
1015915
=== added file 'doc/contributing.rst'
--- doc/contributing.rst 1970-01-01 00:00:00 +0000
+++ doc/contributing.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,187 @@
1For contributors
2================
3
4Source and tracking
5~~~~~~~~~~~~~~~~~~~
6The recipe is currently hosted as a launchpad project, under Bazaar
7version control: https://launchpad.net/anybox.recipe.openerp
8
9We follow the standard launchpad workflow (bugs, merge requests…).
10Code contributors are systematically added to the list of
11contributors at the end of the README, unless they explicitely wish
12not to (what Launchpad does is obvisouly out of our scope).
13
14There are currently no branch naming rules.
15
16Members of the "Anybox" team have push privileges on the main branches.
17
18Using a development version
19~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
21To use a local version of the recipe, you may use the ``develop``
22general buildout option::
23
24 [buildout]
25 develop = /path/to/anybox.recipe.openerp
26
27To track the latest version of a ``bzr`` branch of the recipe, we find
28the
29`gp.vcsdevelop <https://pypi.python.org/pypi/gp.vcsdevelop>`_
30extension simple and useful. Here's an example (excerpt from
31``buildot/recipe-trunk.cfg``)::
32
33 [buildout]
34 extensions = gp.vcsdevelop
35 vcs-extend-develop = bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp
36 vcs-update = True
37
38.. note::
39 Actually some parts of the recipe are aware of the possible use
40 of ``gp.vcsdevelop`` for python dependencies, and special care of it is
41 taken in the freeze and extract features. This is known to work even
42 for ``zc.buildout`` itself.
43
44Development setup
45~~~~~~~~~~~~~~~~~
46
47We recommend "developping" the source code in a virtualenv, together
48with ``bzr``. For instance::
49
50 virtualenv recipe-env
51 recipe-env/bin/pip install bzr
52 recipe-env/bin/bzr branch lp:anybox.recipe.openerp
53 cd anybox.recipe.openerp
54 python setup.py develop
55
56Coding style
57~~~~~~~~~~~~
58
59The recipe follows the same strong code development coding principles
60as many other projects:
61
62* Style enforcement : we follow the PEP8 guidelines
63* Static analysis with `flake8 <https://pypi.python.org/pypi/flake8>`_
64 (combines conveniently `pep8 <https://pypi.python.org/pypi/pep8>`_
65 and `pyflakes <https://pypi.python.org/pypi/pyflakes>`_).
66* Unit tests : we try and test as much as possible. It is hard to achieve a
67 real 100% with a tool that calls so many external processes, but
68 this is mitigated by our
69 :ref:`continuous integration <continuous_integration>` practice of
70 doing real OpenERP installations with the latest revision of the recipe.
71
72Launching static analysis and unit tests
73~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
75Install ``nose``, ``flake8`` and, optionally, ``coverage``::
76
77 recipe-env/bin/pip install nose coverage flake8==2.0 \
78 pep8=1.4.6 mccabe==0.2.1 pyflakes==0.7.3 nose
79
80
81.. note:: we've had problems lately with discrepancies in ``pep8``
82 versions, that's why versions of ``flake8`` and its
83 dependencies are fixed above. In case of doubt, check what
84 the buildbot is actually running.
85
86Run ``flake8`` and the tests::
87
88 cd anybox.recipe.openerp
89 flake8 anybox && nosetests anybox --with-doctest
90
91There is also this convenience to run the tests and output a coverage report::
92
93 source ./test-cover
94
95
96.. _integration tests:
97
98Integration tests
99~~~~~~~~~~~~~~~~~
100
101There is a special category of tests: those that need a real OpenERP
102instance, built with the recipe, to run.
103
104They are located within the ``tests_with_openerp`` subdirectory and
105need to be launched with a launcher script constructed by the recipe.
106
107For example, create a testing buildout like this::
108
109 [openerp]
110 # version as you wish
111 eggs = nose
112 openerp_scripts nosetests command-line-options = -d
113
114Then run ``bin/buildout``, create a database and initialize it. From
115the buildout directory::
116
117 createdb test-recipe
118 bin/start_openerp -d test-recipe -i base --stop-after-init
119
120You can then run the tests::
121
122 bin/nosetests_openerp -d test-recipe -- /path/to/recipe/branch/tests_with_openerp
123
124Currently, these tests are all about the ``Session`` objects, used in
125scripts.
126
127.. note:: you may use a different version of the recipe to build that
128 testing buildout. This is anyway what happens if you build
129 with your development version, and hack some changes
130 afterwards.
131
132 Using a very different version of the recipe could give
133 funky results, but you're supposed to know what you're doing
134 at this point.
135
136
137.. _continuous_integration:
138
139Continuous integration
140~~~~~~~~~~~~~~~~~~~~~~
141
142Basic builds
143------------
144
145Upon each push on the main branches, Anybox' public
146buildbot awakes to check the coding style, run the tests and build
147this documentation. You may check the status there:
148
149* `trunk builder
150 <http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp>`_
151* `stable builder
152 <http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp-stable>`_
153
154Actual runs
155-----------
156
157Furthermore, this buildbot instance runs `anybox.buildbot.openerp
158<https://pypi.python.org/pypi/anybox.buildbot.openerp>`_,
159a buildbot configurator for OpenERP installations based on the recipe.
160
161This is used in turn to run high-level integration tests, having the
162latest bzr version of the recipe actually install several combinations
163of OpenObject server and addons, and run their unit tests.
164
165The configuration is stored in the ``buildbot`` subdirectory of the
166recipe trunk branch. It is made of a high level configuration file
167(``MANIFEST.cfg``) and buildout configuration files. This buildbot
168instance actually aggregates several such configurations.
169
170The corresponding builders are those whose name starts with
171``recipe-`` or ``stable-recipe-`` in the `builders list
172<http://buildbot.anybox.fr/builders>`_.
173
174.. note:: the `integration tests`_ mentioned above are executed in
175 particular during this process, currently in the
176 ``recipe-7.0-postgresql-9.2`` builder.
177
178Some builds may appear to be broken because of tests failures been
179pushed by upstream in OpenERP itself or in the tested addons, but it's
180easy to check whether this is due to a recipe failure or not.
181
182.. note::
183
184 Anybox hardware resources are limited; contributing buildslaves would
185 be greatly appreciated.
186
187
0188
=== added file 'doc/dev_prod_workflow.rst'
--- doc/dev_prod_workflow.rst 1970-01-01 00:00:00 +0000
+++ doc/dev_prod_workflow.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,32 @@
1Full development to production example
2=======================================
3
4In this example, we present one way of organizing a project, to
5provide easy to install development setups, continuous integration and
6production deployments.
7
8Please read this as a pattern among many others. If you decide to base
9your development process on it, you'll have to adapt it to your team's
10practice anyway.
11
12Common setup
13~~~~~~~~~~~~
14
15Developer's setup
16~~~~~~~~~~~~~~~~~
17Here we add private read-write access to version control systems.
18We need to version the buildout itself, and make decisions about which
19addons will be under active development within that project.
20
21At this point, asking a developer to work on the project is as simple
22as providing the main URL to get the buildout from VCS.
23
24Release and packaging
25~~~~~~~~~~~~~~~~~~~~~
26Use of ``freeze-to``, ``extract-downloads-to``, and production of a tarball.
27
28Deployment with a server-local configuration file
29~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30You may decide to track the local files with a VCS, too, but it's
31preferable to keep it distinct from the main code base.
32
033
=== added file 'doc/first_steps.rst'
--- doc/first_steps.rst 1970-01-01 00:00:00 +0000
+++ doc/first_steps.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,351 @@
1First steps
2===========
3
4
5.. _howto:
6
7How to create and bootstrap a buildout
8~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
10To create a buildout and run the build, you just need **1 file** and **2 commands**:
11
12- Create a single ``buildout.cfg`` file.
13- Be sure you installed all your build dependencies
14- Bootstrap the buildout with: ``python bootstrap.py``
15- Run the build with: ``bin/buildout``
16
17The same with more details below :
18
19Creating the buildout
20---------------------
21
22Create a ``buildout.cfg`` file in an empty directory, containing the
23configuration of the `example 6.1`_ section.
24
25.. _dependencies:
26
27Installing build dependencies
28-----------------------------
29
30You basically need typical development tools needed to build all the Python
31dependency eggs of OpenERP. You can do this by yourself with your system or
32Linux distribution.
33
34Or if you're using a Debian based distribution, we provide a single
35dependency package you can use to install all dependencies in one shot:
36
37Add the following line in your ``/etc/apt/sources.list``::
38
39 deb http://apt.anybox.fr/openerp common main
40
41If you don't want your system to complain about non-signed packages,
42have it accept the signing key, e.g. by issuing::
43
44 sudo apt-key adv --keyserver hkp://subkeys.pgp.net --recv-keys 0xE38CEB07
45
46(sometimes, the key server is too busy, you may need to wait a few
47minutes and try again)
48
49Install the dependency package::
50
51 $ sudo aptitude update
52 $ sudo aptitude install openerp-server-system-build-deps
53
54You can uninstall this package with ``aptitude`` after the build to
55automatically remove all un-needed dependencies, but you need to
56install *run dependencies* before that ::
57
58 $ sudo aptitude install openerp-server-system-run-deps
59 $ sudo aptitude remove openerp-server-system-build-deps
60
61Please note that these package will have your system install the
62*client* part of PostgreSQL software only. If you want a
63PostgreSQL server on the same host, that's not in the recipe scope,
64just install it as well.
65
66Bootstrapping the buildout
67--------------------------
68Bootstrapping the buildout consists in creating the basic structure of
69the buildout, and installing buildout itself in the directory.
70Once it's been done, everything is under tight control.
71
72The easiest way to bootstrap is to use the ``bootstrap.py`` script::
73
74 $ wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py
75
76As of zc.buildout version 2.2, strong isolation from the system-wide Python
77installation has been abandoned because of its redundancy with the
78very popular `virtualenv <https://pypi.python.org/pypi/virtualenv>`_.
79Besides, the bootstrap actually fails if a version of
80setuptools older than 0.7 is present system-wide (happens easily
81enough at the time of this writing).
82
83The universal current way of doing is therefore to start from a
84virtualenv *without setuptools*. For virtualenv >= 1.9, just do::
85
86 $ virtualenv sandbox --no-setuptools
87
88For older versions of virtualenv::
89
90 $ virtualenv sandbox
91 $ sandbox/bin/pip uninstall setuptools pip
92
93.. note:: to install virtualenv.
94
95 * Debian family: sudo aptitude install python-virtualenv
96 * Redhat/Fedora/CenOS family: sudo yum install python-virtualenv
97
98Finally, perform the bootstrap with the virtualenv's Python::
99
100 $ sandbox/bin/python bootstrap.py
101
102From now on, all buildout related operations, including OpenERP
103startup script, custom scripts will be protected by this virtualenv.
104
105.. note:: nothing, not even ``zc.buildout`` actually gets installed by
106 buildout in such a virtualenv.
107 It's *totally safe* if you're managing several buildouts to
108 share a single such virtualenv among all of them.
109
110.. note:: since the bootstrap operation is so sensitive, we recommend
111 package managers to include the precise ``bootstrap.py`` in
112 their distributed buildout, and to bundle a future-proof
113 shell script, using options such as ``-v``.
114
115
116Running the build
117-----------------
118
119Just run ::
120
121 $ bin/buildout
122
123Starting OpenERP
124----------------
125
126Just run ::
127
128 $ bin/start_openerp
129
130.. _example 7.0:
131
132Example OpenERP 7.0 buildouts
133~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134This example builds the latest nightly OpenERP 7 version.
135Note how most Python distribution versions are pinned.
136
137While not mandatory, version pinning is an
138important part of the buildout culture. Note also how even ``zc.buildout``
139and the current recipe versions can be pinned::
140
141 [buildout]
142 parts = openerp
143 versions = versions
144 find-links = http://download.gna.org/pychart/
145
146 [openerp]
147 recipe = anybox.recipe.openerp[bzr]:server
148 version = nightly 7.0 latest
149
150 [versions]
151 setuptools = 1.1.0
152 zc.buildout = 2.2.1
153 zc.recipe.eggs = 2.0.0
154 anybox.recipe.openerp = 1.7.1
155 babel = 0.9.6
156 Pillow = 1.7.1
157 pywebdav = 0.9.4.1
158 PyXML = 0.8.4
159 pyyaml = 3.10
160 werkzeug = 0.8.3
161 zsi = 2.0-rc3
162 feedparser = 5.1.1
163 gdata = 2.0.16
164 lxml = 2.3.3
165 psycopg2 = 2.4.4
166 pydot = 1.0.28
167 pyparsing = 1.5.6
168 python-dateutil = 1.5
169 python-ldap = 2.4.9
170 python-openid = 2.2.5
171 pytz = 2012b
172 vatnumber = 1.0
173 vobject = 0.8.1c
174 xlwt = 0.7.3
175
176Of course, installing the latest nightly release provided by OpenERP
177is not really interesting. The flexibility is.
178
179Here's an example with the latest versions of the 7.0 Bazaar branches
180on Launchpad as lightweight checkouts (to avoid hour long downloads).
181We don't repeat the ``buildout`` and ``versions`` sections::
182
183 [openerp]
184 recipe = anybox.recipe.openerp[bzr]:server
185 version = bzr lp:openobject-server/7.0 openerp-7.0 last:1 bzr-init=lightweight-checkout
186 addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1 bzr-init=lightweight-checkout
187 bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons bzr-init=lightweight-checkout
188
189Now imagine how easily one can switch branches and redistribute a
190ready-to-run buildout on some dedicated support branch, Git mirrors, etc.
191
192The next example is on 6.1 and demonstrates both how to add specific addons
193directories, and how uniform it is.
194
195.. _example 6.1:
196
197Example OpenERP 6.1 buildout with a custom addon
198~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199
200Here is a very simple example for a latest OpenERP 6.1 nightly and a
201custom addon hosted on Bitbucket::
202
203 [buildout]
204 parts = openerp
205 versions = versions
206 find-links = http://download.gna.org/pychart/
207
208 [openerp]
209 recipe = anybox.recipe.openerp:server
210 version = nightly 6.1 latest
211 addons = hg https://bitbucket.org/anybox/anytracker addons-at default
212
213 [versions]
214 MarkupSafe = 0.15
215 Pillow = 1.7.7
216 PyXML = 0.8.4
217 babel = 0.9.6
218 feedparser = 5.1.1
219 gdata = 2.0.16
220 lxml = 2.3.3
221 mako = 0.6.2
222 psycopg2 = 2.4.4
223 pychart = 1.39
224 pydot = 1.0.28
225 pyparsing = 1.5.6
226 python-dateutil = 1.5
227 python-ldap = 2.4.9
228 python-openid = 2.2.5
229 pytz = 2012b
230 pywebdav = 0.9.4.1
231 pyyaml = 3.10
232 reportlab = 2.5
233 simplejson = 2.4.0
234 vatnumber = 1.0
235 vobject = 0.8.1c
236 werkzeug = 0.8.3
237 xlwt = 0.7.3
238 zc.buildout = 1.5.2
239 zc.recipe.egg = 1.3.2
240 zsi = 2.0-rc3
241
242
243.. note:: with OpenERP 6.1 the web client is natively included in the server as a
244 simple module. In that case you don't need to write a separate part for the web
245 client, unless that's what you really want to do.
246
247
248Example OpenERP 6.0 buildout (server and clients)
249~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250
251Here is a sample buildout with version specification, 2 OpenERP servers (with
252one using the latest 6.0 branch on the launchpad) using only NETRPC and
253listening on 2 different ports, and 2 web clients::
254
255 [buildout]
256 parts = openerp1 web1 openerp2 web2
257 #allow-picked-versions = false
258 versions = versions
259 find-links = http://download.gna.org/pychart/
260
261 [openerp1]
262 recipe = anybox.recipe.openerp:server
263 version = 6.0.3
264 options.xmlrpc = False
265 options.xmlrpcs = False
266
267 [web1]
268 recipe = anybox.recipe.openerp:webclient
269 version = 6.0.3
270
271 [openerp2]
272 recipe = anybox.recipe.openerp[bzr]:server
273 version = bzr lp:openobject-server/6.0 openobject-server-6.x last:1
274
275 options.xmlrpc = False
276 options.xmlrpcs = False
277 options.netrpc_port = 8170
278
279 [web2]
280 recipe = anybox.recipe.openerp:webclient
281 version = 6.0.3
282 global.openerp.server.port = '8170'
283 global.server.socket_port = 8180
284
285 [versions]
286 MarkupSafe = 0.15
287 Pillow = 1.7.7
288 anybox.recipe.openerp = 0.9
289 caldav = 0.1.10
290 collective.recipe.cmd = 0.5
291 coverage = 3.5
292 distribute = 0.6.25
293 feedparser = 5.0.1
294 lxml = 2.1.5
295 mako = 0.4.2
296 nose = 1.1.2
297 psycopg2 = 2.4.2
298 pychart = 1.39
299 pydot = 1.0.25
300 pyparsing = 1.5.6
301 python-dateutil = 1.5
302 pytz = 2012b
303 pywebdav = 0.9.4.1
304 pyyaml = 3.10
305 reportlab = 2.5
306 vobject = 0.8.1c
307 z3c.recipe.scripts = 1.0.1
308 zc.buildout = 1.5.2
309 zc.recipe.egg = 1.3.2
310 Babel = 0.9.6
311 FormEncode = 1.2.4
312 simplejson = 2.1.6
313
314Continuously tested examples
315~~~~~~~~~~~~~~~~~~~~~~~~~~~~
316
317Other examples are available in the ``buildbot`` subdirectory of the
318source distribution archive of this recipe (the ``tar.gz`` file that
319can be downloaded `from the PyPI
320<http://pypi.python.org/pypi/anybox.recipe.openerp>`_), and are
321continuously tested in the
322`anybox buildbot <http://buildbot.anybox.fr/>`_ which is powered by
323`anybox.buildbot.openerp
324<http://pypi.python.org/pypi/anybox.buildbot.openerp>`_.
325
326See also :ref:`continuous_integration` for more details about these
327tested examples.
328
329Other sample buildouts
330~~~~~~~~~~~~~~~~~~~~~~
331
332Here are a few ready-to-use buildouts:
333
334(Be sure to install system dependencies_ first)
335
336OpenERP with the development branches of the Magento connector addons::
337
338 $ hg clone https://bitbucket.org/anybox/openerp_connect_magento_buildout
339 $ cd openerp_connect_magento_buildout
340 $ python bootstrap.py
341 $ bin/buildout
342 $ bin/start_openerp
343
344OpenERP with the development branches of the Prestashop connector addons::
345
346 $ hg clone https://bitbucket.org/anybox/openerp_connect_prestashop_buildout
347 $ cd openerp_connect_prestashop_buildout
348 $ python bootstrap.py
349 $ bin/buildout
350 $ bin/start_openerp
351
0352
=== added file 'doc/index.rst'
--- doc/index.rst 1970-01-01 00:00:00 +0000
+++ doc/index.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,79 @@
1.. OpenERP buildout recipe documentation master file, created by
2 sphinx-quickstart on Wed Jul 24 18:32:19 2013.
3 You can adapt this file completely to your liking, but it should at least
4 contain the root `toctree` directive.
5
6OpenERP buildout recipe
7=======================
8
9This recipe for `Buildout <https://github.com/buildout/buildout>`_ is
10a fully featured tool allowing you to define and deploy quickly
11OpenERP installations of any kinds, ranging from development setups to
12fully automated production deployments or continuous integration.
13
14Some of its main features include:
15
16* uniformity across OpenERP versions (from 5.0 onwards)
17* installation of OpenERP server and, if meaningful, GTK and web clients.
18* retrieval of main software and addons from various sources,
19 including the major version control systems
20* ability to pinpoint everything for replayability
21* management of OpenERP configuration
22* dedicated scripts creation for easy integration of external tools,
23 such as test launchers
24* packaging: creation of self-contained equivalents for easy
25 deployment in tightly controlled hosting environmenents.
26
27All these to be considered together with zc.buildout‘s general
28properties, such as an extensible configuration file format for easy
29variation or separation of concerns, native Python distributions
30installation, and of course the huge ecosystem of other recipes.
31
32About this documentation
33------------------------
34
35The full documentation is written with `Sphinx
36<http://sphinx-doc.org>`_, built continuously and
37uploaded to http://docs.anybox.fr/anybox.recipe.openerp/trunk by Anybox' public
38buildbot.
39The Sphinx source tree is to be found under the ``doc`` subdirectory
40of this project.
41
42Although this Sphinx documentation started with version 1.8.0, most of
43its contents applies to the 1.7 series: features introduced with 1.8
44are highlighted, and readers may consult the `changelog on PyPI
45<https://pypi.python.org/pypi/anybox.recipe.openerp#changes>`_.
46
47We plan to upload released versions of the documentation to
48http://pythonhosted.org
49
50Contents
51--------
52
53.. toctree::
54 :maxdepth: 2
55 :glob:
56
57 first_steps
58 configuration
59 scripts
60 dev_prod_workflow
61 contributing
62
63Code documentation
64------------------
65
66.. toctree::
67 :maxdepth: 1
68 :glob:
69
70 apidoc/anybox*
71
72
73Indices and tables
74------------------
75
76* :ref:`genindex`
77* :ref:`modindex`
78* :ref:`search`
79
080
=== added file 'doc/scripts.rst'
--- doc/scripts.rst 1970-01-01 00:00:00 +0000
+++ doc/scripts.rst 2014-02-06 07:42:46 +0000
@@ -0,0 +1,471 @@
1OpenERP Scripts
2===============
3
4The server recipe actually includes a general engine to install Python
5code that needs access to the OpenERP API and build
6configuration-aware executables.
7
8As usual, it tries and do so by bridging the standard Python packaging
9practice (setuptools-style console scripts, as in
10``zc.recipe.egg:scripts``) and OpenERP specificities.
11
12We call such scripts *OpenERP scripts* to distinguish them among the
13more general concept of console scripts.
14
15.. warning:: OpenERP scripts are currently supported for OpenERP ≥ 6.1 only.
16
17
18Use cases
19~~~~~~~~~
20
21OpenERP scripts can do great in situations where an RPC script might
22not be powerful enough or not practical. Some examples:
23
24* specific batch jobs, especially for large databases (you get to
25 control the transaction).
26* introspection tools.
27* general-purposes test launchers that don't have any knowledge of
28 OpenERP specifics, such as ``nose``. See :ref:`command_line_options`
29 for details about that.
30
31OpenERP vs RPC scripts for administrative tasks
32-----------------------------------------------
33
34There are several Python distributions that wrap the OpenERP RPC APIs
35for easy use within Python code.
36
37Using an RPC script for administrative tasks usually leads to
38wrap it in a shell script, with the admin password in clear text.
39
40In this author's experience of applicative maintainance,
41this always turns to be an
42easy source of breakage that may look to be trivial at first sight but
43has actually two nasty properties : it may stay unnoticed for a while,
44and it lies at the interface between responsibilities.
45
46In case of password change, the persons who can do it
47in the database and in the system usually differ, and may not
48communicate on a regular basis. In enterprise hosting environments,
49you may have to explain stuff to several project managers with
50different responsabilities, go through crisis management meetings,
51etc. Who wants to waste hours of their life interacting with people
52under stress to try and persuade them that it's only a matter of
53changing an obscure password ?
54
55
56OpenERP scripts vs Openerp cron jobs
57------------------------------------
58
59Because they are part of addons, OpenERP cron jobs also have full
60unrestricted access to the internal API, and obviously don't suffer
61from the password plague.
62
63Some ideas to make a choice:
64
65* who should control, schedule and tune execution (a system administrator or
66 a functional admin)
67* which one the script author finds easiest to write for
68* reuse and distribution issues : OpenERP scripts are in Python
69 distributions, cron jobs are in addons.
70* OpenERP scripts must implement their own transaction control,
71 whereas cron jobs don't bother about it but rely on the framework's
72 decisions.
73
74Perhaps, the best is not to choose : put the bulk of the logic in some
75technical addon, it's easy to rewrap it in an OpenERP script and as a
76cron job.
77
78
79Declaring OpenERP Scripts
80~~~~~~~~~~~~~~~~~~~~~~~~~
81There are several cases, depending on the script authors
82intentions. Script authors should therefore state clearly in their
83documentation how to declare them.
84
85Assume to fix ideas there is a Python distribution ``my.script``
86that declares a console script entry point named ``my_script`` in its
87``setup.py``::
88
89 entry_points="""
90
91 [console_scripts]
92 my_script = my.script.main:run
93 """
94
95The first thing to do is to require that distribution using the
96``eggs`` option::
97
98 [my-openerp]
99 (...)
100 eggs = my.script
101
102:ref:`How that distribution can be made available to buildout
103<making_available>` is a different question.
104
105Bare declararations
106-------------------
107The following configuration::
108
109 [openerp-one]
110 (...)
111 openerp_scripts = my_script
112
113Produces an executable ``bin/my_script-openerp-one``, that can import
114OpenERP server and addons code, and in which the OpenERP configuration
115related to the appropriate buildout part (here, ``openerp-one``) is
116loaded in the standard ``openerp.tools.config``, for use in the
117script. The script has to take care of all database management operations.
118
119Optionally, it's possible to specify the name of the produced script::
120
121 [openerp-one]
122 (...)
123 openerp_scripts = my_script=wished_name
124
125That would build the script as ``bin/wished_name``.
126
127This is good
128enough for scripts that'd take care of many bootstrapping details, but
129there is a more integrated way that script authors should be aware of:
130the special ``session`` argument.
131
132.. _arguments_session:
133
134Arguments and session
135---------------------
136.. note:: new in version 1.7.0
137
138An ``arguments`` parameter, similar to the one of
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: