Giter Club home page Giter Club logo

acsoo's Introduction

acsoo - Acsone Odoo Dev Tools

License: GPL-3 https://travis-ci.org/acsone/acsoo.svg?branch=master

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
pip install --user acsoo

or

pipx install acsoo

Note

Since acsoo has a lot of dependencies that are not required at runtime, for your application, it is not recommanded to install it in the same virtualenv as your project.

To enable bash completion, add this line in your .bashrc:

eval "$(_ACSOO_COMPLETE=source acsoo)"

Below, the list of available commands with a few examples.

Use acsoo --help or acsoo <command> --help for more information.

Look for git references of the form refs/pull/NNN/head in requirement files and print the corresponding GitHub pull request status.

acsoo checklog is deprecated: use `checklog-odoo <https://pypi.org/project/checklog-odoo>`_

Check if an odoo log file contains 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

acsoo tag is deprecated: use `bump2version <https://pypi.org/project/bump2version/>`_ with `tag = True`, followed ``git push --tags`` instead.

Tag the current project after ensuring everything has been commited to git.

acsoo tag-requirements is deprecated: use `pip-preserve-requirements <https://pypi.org/project/pip-preserve-requirements/>`_ instead. In addition to tagging, it automatically pushes thirdparty repositories to the corresponding ACSONE fork, simplifying the declaration of OCA VCS references using ``@refs/pull/NNN/head``.

Tag all VCS requirements found in requirements.txt, so the referenced commits are not lost in case of VCS garbage collection.

acsoo addons is deprecated: use `manifestoo <https://pypi.org/project/manifestoo>`_ instead: it is more robust and has better test coverage.

A set of commands to print addons lists, useful when running tests.

acsoo addons list
acsoo addons list-depends

Deprecated: use `pip-deepfreeze <https://pypi.org/project/pip-deepfreeze>`_ instead.

Just like pip freeze, except it outputs only dependencies of the provided distribution name.

This command is deprecated, use pip >= 20.1 and do not use editable VCS dependencies. `pip wheel -e . -r requirements.txt --wheel-dir=release` will then give the same result, including caching of pinned VCS dependencies.

Build wheels for all dependencies found in requirements.txt, plus the project in the current directory.

The main advantage of this command (compared to a regular pip wheel -r requirements.txt -e . --wheel_dir=release --src src), was that it maintains a cache of git dependencies that are pinned with a sha1.

This command is deprecated. Releasing is automated via .gitlab-ci. See the `build` stage in the project template.

Perform acsoo tag, acsoo tag_requirements and acsoo wheel in one command.

A file named acsoo.cfg at the project root helps you set sensible defaults.

Here is a minimal example:

[acsoo]
trigram=xyz
series=10.0
version=1.5.0

And a more elaborate example:

[acsoo]
trigram=xyz
series=11.0
version=1.5.2
pushable=
  github.com:acsone
  github.com:mozaik

[checklog]
ignore=
  WARNING .* module .*: description is empty !
  WARNING: unable to set column .* of table account_analytic_account not null
ACSONE SA/NV

This project is maintained by ACSONE SA/NV.

acsoo's People

Contributors

acsonefho avatar adrienpeiffer avatar benwillig avatar francomaxime avatar lmignon avatar olivier-laurent avatar qgroulard avatar rousseldenis avatar sbejaoui avatar sbidoul avatar thomasbinsfeld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acsoo's Issues

New command: acsoo addons toupdate

An important building block to do faster updates when deploying.

List addons that have changed between two versions of a project, including dependencies.

It takes one argument: the git reference to which the version in current directory needs to be compared.

Algorithm

Clone git ref in a temp directory

Diff addons found in project:

  • Use existing logic to find addons to compare (with a bit of refactoring to move that logic to manifest.py)
  • for each addon found, recursive compare directory content (using git diff -- path or python dircmp): add addon to list if any change is found
  • quid if addon present in other but not in self (case of a removed addon)

Compare dependencies:

  • If -r (--diff-requirements) option provided, compare requirements.txt of both projects
  • If no requirements.txt found in project, error
  • If not requirements.txt found in other version, returns ‘all’
  • To parse the requirements file, use https://pypi.python.org/pypi/requirements-parser (new dependency -
    for acsoo)
  • Special case for the odoo egg: if version or git ref differs, return ‘all’
  • look at the #egg= parts (matching odoo[0-9]+[-_]addon[-_].*)
  • If one is editable and the other not, add the addon to the list
  • If both are editable, compare the sha (and repo url?)
  • If both have a version number, compare the version number
  • Cherry on the cake, if egg matches odoo[0-9]*-addons-.*, apply the comparison to the two versions (in a first version, return ‘all’ if the versions differ: we have three projects with that case: lih, liser, ecolo)

Additional check: verify that the commit we are comparing to is an ancestor of the current commit. If not a partial -u could lead to inconsistencies.

Simplify acsoo wheel when pip 20.0 is released

When pip 20.0 is released, we can remove the caching mechanism from acsoo wheel, since that feature is now in pip master.

cat requirements.txt | sed -e 's/^-e //' | pip wheel -r -

should behave similarly.

New command: acsoo pgenv -c odoo.cfg

Generate postgres client environment variables from and odoo configuration file, so they can be evaluated in a posix shell.

Example output:

PGHOST=... ; export PGHOST
PGPORT=... ; export PGPORT
PGUSER=... ; export PGUSER
PGPASSWORD=... ; export PGPASSWORD
PGDATABASE=... ; export PGDATABASE

Example usage:

eval $(acsoo pgenv -c odoo.cfg)

acsoo pr-status: To html

A good improvement could be an argument to generate an html page (or fragment) for acsoo pr-status.

That page could be included in projects pages or ...

@sbidoul What do you think ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.