Acsone Odoo Dev Tools
Project description
This is a set of command-line utilities to facilitate the Odoo development workflow at Acsone.
It assumes the project is a setuptools-based python package that can be packaged and installed with pip.
Criteria for tools to be included here:
being small wrappers around standard commands (git, pip, etc)
yet being sufficiently non-trivial to be error-prone or time consuming when done manually
being used across several Acsone Odoo projects
Installation
pip install acsoo
To enable bash completion, add this line in your .bashrc:
eval "$(_ACSOO_COMPLETE=source acsoo)"
What we have here
Below are is the list of available commands wth a few examples.
Use acsoo --help or acsoo <command> --help for more information.
Initialize a new project
mrbob acsoo:templates/project cd {project name} mkvirtualenv {project name} -a .
acsoo tag
Tag the current project after ensuring everything has been commited to git.
acsoo tag_editable_requirements
Tag all editable requirements found in requirements.txt, so the referenced commits are not lost in case of git garbage collection.
acsoo wheel
Build wheels for all dependencies found in requirements.txt, plus the project in the current directory.
This is actually almost trivial (ie pip wheel -r requirements.txt -e .), but works around a pip quirk.
acsoo release
Perform acsoo tag, acsoo tag_editable_requirements and acsoo wheel in one command.
acsoo flake8
Run flake8 with sensible default for Odoo code.
It is possible to pass additional options to the flake8 command, eg:
acsoo flake8 -- --ignore E24,W504
acsoo pylint
Run pylint on the odoo or odoo_addons namespace. It automatically uses the pylint-odoo plugin and runs with a reasonable configuration, including an opinionated set of disabled message.
It is possible to pass additional options to the pylint command, eg:
acsoo pylint -- --disable missing-final-newline odoo
This command returns an non-zero exit code if any message is reported. It is however possibly to display messages while reporting success, eg:
acsoo pylint --expected api-one-deprecated:2,line-too-long -- odoo
The above command succeeds despite having exactly 2 api-one-deprecated or any number of line-too-long messages being reported.
It is also possible to force failure on messages that are expected in the default configuration, eg to fail on fixme errors, just expect 0 fixme messages, like this:
acsoo pylint --expected fixme:0 -- odoo
acsoo addons
A set of commands to print addons lists, useful when running tests.
acsoo addons list acsoo addons list-depends
acsoo checklog
Check if an odoo log file conatains error, with the possibility to ignore some errors based on regular expressions.
acsoo checklog odoo.log odoo -d mydb -i base --stop-after-init | acsoo checklog acsoo checklog --ignore "WARNING.*blah" odoo.log
Ideas
acsoo freeze
pip freeze (which works very well as is) with the following additions
exluding some common dev tools that are not required in production (pudb, ipdb, acsoo, git-aggregator, setuptools-odoo…) and their dependencies unless such dependencies are required by the project (directly or indirectly).
excluding the project itself (as usual for python requirements.txt files)
Inspiration to be found in https://pypi.python.org/pypi/pipdeptree, although I don’t think acsoo should depend on that, as it’s only a thin wrapper around the pip api.
acsoo version
A helper to bump version in acsoo.cfg and also bump version in (some?) odoo addons, such as the main addon that pulls dependencies. Requires further thinking.
Useful links
pypi page: https://pypi.python.org/pypi/acsone
code repository: https://github.com/acsone/acsoo
report issues at: https://github.com/acsone/acsoo/issues
Maintainer
This project is maintained by ACSONE SA/NV.
Changes
1.2.2 (2017-05-30)
[FIX] regression in tag, tag_editable_requirements and release commands.
1.2.1 (2017-05-27)
[IMP] add possibility to provide main config file as option.
[IMP] checklog: read default options from [checklog] section of config file.
[IMP] pylint: read default options from [pylint] section of config file.
[IMP] pylint: the module or package to lint may be provided with -m.
[IMP] flake8: read default options from [flake8] section of config file. The only option so far is config to provide an alternate flake8 configuration file. This is useful so developer only need to type acsoo flake8 locally, even when a specific configuration is needed, so it’s trivial to run locally with the same config as in CI.
1.1.0 (2017-05-25)
[IMP] pylint: BREAKING the package to test must be provided explicitly, as soon as additional pylint options are provided, so as to enable easy local testing of a subset of a project. Examples: acsoo pylint -- -d some-message odoo, acsoo pylint -- odoo.addons.xyz;
[IMP] pylint: disable more code complexity errors: too-many-nested-blocks, too-many-return-statements.
[IMP] pylint: display messages causing failure last, so emails from CI. that show the last lines of the log are more relevant.
[IMP] pylint: display summary of messages that did not cause failure, also when there is no failure.
[ADD] acsoo addons list and acsoo addons list-depends.
[ADD] acsoo checklog.
1.0.1 (2017-05-21)
First public release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file acsoo-1.2.2.tar.gz
.
File metadata
- Download URL: acsoo-1.2.2.tar.gz
- Upload date:
- Size: 50.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe566e61cc42a93ce2e4a8c4536d9eb397840831e02cb22c770c2e9fe04caaef |
|
MD5 | c46e77078fe209f674b80ef735ea839c |
|
BLAKE2b-256 | 1e144871aee50d0af3c2d60d13c5a5e6a27a3c8af72582361cfc49a7fba8035d |
File details
Details for the file acsoo-1.2.2-py2-none-any.whl
.
File metadata
- Download URL: acsoo-1.2.2-py2-none-any.whl
- Upload date:
- Size: 50.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61b4de5c48dc97674bae56a7c8ff5d93aed562d42a562d28b217cfedb645109e |
|
MD5 | ed28b80e79e246035f357aaf8df1f59c |
|
BLAKE2b-256 | cc408effb1a94a511232518e2659c59f505c1b3ff775ef2b8e1151d4fce1c7b1 |