Skip to content
Snippets Groups Projects
README.rst 12.43 KiB

Odoo Scripts

Installation

Most commands can be run directly or with the image build from Dockerfile (xcgd/odoo_scripts) by indicating the command to run, but the best way to use this module is to install it. Installing will also install dependencies.

pip need to be more recent than version 10.0 to use it to install.

The recommend way to install this module is to run python3 -m pip install odoo_scripts==20.8.2 --extra-index-url https://pypi.xcg.io/simple.

Some scripts are in other sections, because they need some specialized library, in that case you need to indicate the name of section as in python3 -m install "odoo_scripts[docker]==20.8.2" --extra-index-url https://pypi.xcg.io/simple. The prerequisites for this module or one of its section can be installed by using pip3 or the package manager; the requirements are defined in pyproject.toml.

To upgrade Odoo scripts, just add --upgrade to the end of the command.

It can also be cloned before running python3 -m pip install . in the clone directory, and with pip version 21.3+ and a recent setuptools, it can use the cloned repository by adding --editable/-e.

Important

As there is no way of indicating sections (worse, it is handling them incorrectly), do not use python3 setup.py install.

Note that shell scripts are not installed, as they are meant to be replaced with more easily maintanable python scripts.

Scripts

Those scripts are available when installing the package, and can also be run directly.

docker_black

Run dockerized black on provided directory. black must be present in the project image.

This is part of the docker section.

docker_build_doc

Build documentation in docker. It runs make html so could potentially be used to do something else.

This is part of the docker section.

docker_isort

Run dockerized isort on current directory. This uses a configuration file that is adapted to OCA guidelines for imports.

This is part of the docker section.

docker_pylint

Run dockerized pylint on provided module name. Pylint must be present in the project image.

This is part of the docker section.