File: setup.rst

package info (click to toggle)
tryton-server 7.0.40-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,748 kB
  • sloc: python: 53,502; xml: 5,194; sh: 803; sql: 217; makefile: 28
file content (67 lines) | stat: -rw-r--r-- 1,712 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.. _tutorial-module-setup:

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:

.. code-block:: console

   $ python -m venv .venv
   $ source .venv/bin/activate

Install cookiecutter and mercurial
----------------------------------

To bootstrap the module, we provide a cookiecutter_ template.
First we install cookiecutter_ and mercurial_ with:

.. code-block:: console

   $ python -m pip install cookiecutter mercurial

Setup module
------------

The Tryton template can be rendered into a module with:

.. code-block:: console

   $ 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:

.. code-block:: console

   $ python -m pip install --editable opportunity

Continue with :ref:`initializing the database <tutorial-module-setup-database>`

.. _pip: https://pip.pypa.io/
.. _venv: https://docs.python.org/library/venv.html
.. _cookiecutter: https://pypi.org/project/cookiecutter/
.. _mercurial: https://www.mercurial-scm.org/