-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.md.jinja
93 lines (66 loc) · 3.43 KB
/
README.md.jinja
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Odoo for {{ project_name }}
**Table of Contents**
- [Odoo for {{ project_name }}](#odoo-for-{{ project_name|lower|replace(' ', '-') }})
- [Development environment howto](#development-environment-howto)
- [Development requirements](#development-requirements)
- [Preliminary steps](#preliminary-steps)
- [Initialize virtualenv](#initialize-virtualenv)
- [Install everything](#install-everything)
- [Develop](#develop)
- [Run](#run)
- [Running tests](#running-tests)
- [Release](#release)
## Development environment howto
### Development requirements
- Install [pip-deepfreeze](https://pypi.python.org/pypi/pip-deepfreeze) with `pipx install pip-deepfreeze`
- Install [pip-preserve-requirements](https://pypi.python.org/pypi/pip-preserve-requirements) with `pipx install pip-preserve-requirements`
- Install [bump2version](https://pypi.python.org/pypi/bump2version) with `pipx install bump2version`
- [git-aggregator](https://pypi.python.org/pypi/git-aggregator) (`pipx install git-aggregator`) is also occasionally useful to
combine multiple pull requests into a single branch (see `gitaggregate.yaml`).
- To make git-aggregate run faster on large repositories such as Odoo, it is recommended to install [git-autoshare](https://pypi.python.org/pypi/git-autoshare) with `pipx install
git-autoshare`. Don't forget to configure it according to the documentation.
### Preliminary steps
- Clone the repository
- Prepare the project-specific Odoo branch by running `gitaggregate -c gitaggregate.yaml -p`.
- Pin the build dependencies using for CI by running `./sync-build.sh`
### Initialize virtualenv
- Create and activate virtualenv, possibly with virtualenvwrapper's
`mkvirtualenv odoo-{{ project_name|lower|replace(' ', '-') }} -a . --python=python{{ python_version }}`
### Install everything
Some dependencies are not available on PyPI as manylinux wheels, so you need
to have a C compiler,the Python headers and some additional dev
packages installed in order to compile them. The list of packages can be
found in the `build-deps` stage of the [Dockerfile](./Dockerfile)
As an alternative, you can reference the wheelhouse from ACSONE in the pip
environment variable before launching the pip-df command::
export PIP_FIND_LINKS=https://wheelhouse.acsone.eu/manylinux2014
In an activated python {{ python_version }} virtualenv, run::
pip-df sync
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.
### Develop
This project uses [black](https://pypi.org/project/black) and other code formatters.
To make sure local coding convention are respected before
you commit, install [pre-commit](https://pypi.org/project/pre-commit) and
run `pre-commit install` after cloning the repository.
## Run
```
odoo -c odoo.cfg
```
## Running tests
To run tests as usual
```
odoo --test-enable
```
To run tests with pytest Odoo
```
pytest --odoo-database=<dbname> odoo/addons
```
## Release
1. 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`.
2. Update the version number using `bumpversion patch|minor|major` and push the tag
that bumpversion created with `git push --follow-tags`.
3. The deploy to the test environment will be automatic, and GitLab will show buttons
on the pipeline to deploy to other environments.