| 1 |
.. _download-install: |
| 2 |
|
| 3 |
Download and install instructions |
| 4 |
================================= |
| 5 |
|
| 6 |
Install from PyPI |
| 7 |
----------------- |
| 8 |
|
| 9 |
You can install `OdooRPC` with `pip`:: |
| 10 |
|
| 11 |
$ pip install odoorpc |
| 12 |
|
| 13 |
Install from GitHub |
| 14 |
------------------- |
| 15 |
|
| 16 |
To install the latest development branch with `pip`:: |
| 17 |
|
| 18 |
$ pip install git+https://github.com/OCA/odoorpc.git@master |
| 19 |
|
| 20 |
Install from sources |
| 21 |
-------------------- |
| 22 |
|
| 23 |
The project is hosted on `GitHub <https://github.com/OCA/odoorpc>`_. |
| 24 |
To get the last development sources (``master`` branch), just type:: |
| 25 |
|
| 26 |
$ git clone https://github.com/OCA/odoorpc.git |
| 27 |
$ cd odoorpc/ && python setup.py install |
| 28 |
|
| 29 |
Contribute |
| 30 |
---------- |
| 31 |
|
| 32 |
The project uses `pre-commit` to check the code. To make your life easier you |
| 33 |
are encouraged to install `pre-commit`:: |
| 34 |
|
| 35 |
$ pip install pre-commit |
| 36 |
|
| 37 |
And initialize it at the root of the project source tree:: |
| 38 |
|
| 39 |
$ cd ./odoorpc/ && pre-commit install |
| 40 |
|
| 41 |
`pre-commit` will now check your changes when commiting and abort the operation |
| 42 |
if the code is not in a good health. |
| 43 |
|
| 44 |
Run tests |
| 45 |
--------- |
| 46 |
|
| 47 |
Unit tests depend on the standard module `unittest` (Python 2.7 and 3.x) and |
| 48 |
on a running Odoo instance. |
| 49 |
To run all unit tests from the project directory, run the following command:: |
| 50 |
|
| 51 |
$ python -m unittest discover -v |
| 52 |
|
| 53 |
To run a specific test:: |
| 54 |
|
| 55 |
$ python -m unittest -v odoorpc.tests.test_init |
| 56 |
|
| 57 |
To configure the connection to the server, some environment variables are |
| 58 |
available:: |
| 59 |
|
| 60 |
$ export ORPC_TEST_PROTOCOL=jsonrpc |
| 61 |
$ export ORPC_TEST_HOST=localhost |
| 62 |
$ export ORPC_TEST_PORT=8069 |
| 63 |
$ export ORPC_TEST_DB=odoorpc_test |
| 64 |
$ export ORPC_TEST_USER=admin |
| 65 |
$ export ORPC_TEST_PWD=admin |
| 66 |
$ export ORPC_TEST_VERSION=12.0 |
| 67 |
$ export ORPC_TEST_SUPER_PWD=admin |
| 68 |
$ python -m unittest discover -v |
| 69 |
|
| 70 |
The database ``odoorpc_test`` will be created if it does not exist. |
| 71 |
|
| 72 |
If you have `Docker` installed, an handy script will help you to run the tests |
| 73 |
on a dockerized Odoo instance:: |
| 74 |
|
| 75 |
$ ./run_tests_docker.sh |
| 76 |
|
| 77 |
The same environment variables described above apply:: |
| 78 |
|
| 79 |
$ ORPC_TEST_VERSION=11.0 ./run_tests_docker.sh |