====={{{ "=" * project.name|length }}}
Odoo {{{ project.name|capitalize }}}
====={{{ "=" * project.name|length }}}

.. contents::

Development environment howto
=============================

Initialize virtualenv
---------------------

- create and activate virtualenv, using python 3's standard `python -m venv` or possibly with virtualenvwrapper's
  ``mkvirtualenv odoo-{{{ project.name }}} -a . --python=$(which python{{{ project.python_version }}})``
- make sure acsoo [#]_ and pip-deepfreeze [#]_ are installed and in your PATH
- to save some time it is recommended to configure git-autoshare [#]_.

Pin build dependencies
----------------------

Use ``./sync-build.sh`` to update pinned build dependencies from
``requirements-build.txt.in`` to ``requirements-build.txt`` (empty
``requirements-build.txt`` first to update them all).

Install everything
------------------

In an activated python{{{ project.python_version }}} virtualenv, run::

   pip-df sync -x test,doc,dev

When dependencies change, use ``pip-df sync`` again, possibly with
``--update``. Add unmerged VCS dependencies in ``requirements.txt.in``. See the
pip-deepfreeze documentation for more information.

Run
---

Copy ``odoo.cfg.template`` to ``odoo.cfg`` and update it as needed, then run::

   odoo -c odoo.cfg


Develop
-------

This project uses Black [#]_ and other code formatters.
To make sure local coding convention are respected before
you commit, install pre-commit [#]_ and
run ``pre-commit install`` after cloning the repository.

Release
-------

First make sure you have been testing using the correct dependencies by
running ``pip-df sync`` and checking there is no change in ``requirements.txt``.

To release using gitlab-ci
..........................

- run acsoo tag, the deploy to the test environment will be automatic, and
  gitlab will show a button on the pipeline to deploy to production.

.. [#] https://pypi.python.org/pypi/acsoo/#installation
.. [#] https://pypi.python.org/pypi/pip-deepfreeze
.. [#] https://pypi.python.org/pypi/git-autoshare
.. [#] https://github.com/psf/black
.. [#] https://github.com/pre-commit/pre-commit
