Setup#

Create virtual environment#

This step will cover the installation of tryton from a developer perspective. We will assume that you are already fluent with venv and pip.

Let’s create a virtual environment inside your working directory:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ python -m pip install --upgrade pip

Install cookiecutter and mercurial#

To bootstrap the module, we provide a cookiecutter template. First we install cookiecutter and mercurial with:

$ python3 -m pip install cookiecutter mercurial

Setup module#

The Tryton template can be rendered into a module with:

$ cookiecutter hg+https://code.tryton.org/tryton --directory cookiecutter-module
module_name [my_module]: opportunity
prefix []: tuto
package_name [tuto_opportunity]:
version []: x.y.0
description []:
author [Tryton]: John Doe
author_email [bugs@tryton.org]: john@example.com
fullname []: John Doe
url [http://www.tryton.org/]: http://www.example.com/
keywords []:
test_with_scenario []:

Note

The version number must use the same two first numbers as the Tryton series wanted.

Install module#

Now we can install the new module in editable mode:

$ python3 -m pip install --use-pep517 --editable opportunity

Continue with initializing the database