Commit Graph

7 Commits (76ea08b51eb88dbad2b854c46e708ae69401c5c6)

Author SHA1 Message Date
Stefan Rijnhart 91de08976e [UPD] dotfiles 2023-01-15 15:19:31 +01:00
tbanevicius 24747c7a3c [IMP] module_auto_update: Improved README.rst
sample_module was identified as a real module in pylint + pre-commit.
Updated README.rst
2022-03-21 13:56:51 +02:00
Miku Laitinen ae00f76f38 [MIG] module_auto_update: Migration to 15.0 2021-12-27 17:39:03 +02:00
Eric Antones e5f4fd42f0 [IMP] module_auto_update: black, isort, prettier 2021-12-27 16:49:36 +02:00
Simone Orsi f4588878da Global pylint cleanup 2021-12-27 16:49:36 +02:00
Jairo Llopis d93d9c90bc [FIX] module_auto_update: Add .pyo sample file (#1205)
Without this patch, if your tests are run under a `PYTHONOPTIMIZE=2` precompiled environment, they'd fail with this error because a new `.pyo` file would be created.:

    FAIL: test_basic (openerp.addons.module_auto_update.tests.test_addon_hash.TestAddonHash)
    Traceback (most recent call last):
    `   File "/opt/odoo/auto/addons/module_auto_update/tests/test_addon_hash.py", line 41, in test_basic
    `     'static/src/some.js',
    ` AssertionError: Lists differ: ['README.rst', 'data/f1.xml', ... != ['README.rst', 'data/f1.xml', ...
    `
    ` First differing element 13:
    ` models/stuff.pyo
    ` static/src/some.js
    `
    ` First list contains 1 additional elements.
    ` First extra element 14:
    ` static/src/some.js
    `
    `   ['README.rst',
    `    'data/f1.xml',
    `    'data/f2.xml',
    `    'i18n/en.po',
    `    'i18n/en_US.po',
    `    'i18n/fr.po',
    `    'i18n/fr_BE.po',
    `    'i18n/test.pot',
    `    'i18n_extra/en.po',
    `    'i18n_extra/fr.po',
    `    'i18n_extra/nl_NL.po',
    `    'models/stuff.py',
    `    'models/stuff.pyc',
    ` -  'models/stuff.pyo',
    `    'static/src/some.js']
    Ran 3 tests in 0.005s
    FAILED

With this patch, the `.pyo` file is included, so tests will pass anywhere.
2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) a1f71e9ad6 [REF] module_auto_update: Step 2, add new API
This code comes from the module_checksum_upgrade proposal
at https://github.com/OCA/server-tools/pull/1176.

* [ADD] module_checksum_upgrade

It provides the core mechanism of module_auto_update without
the cron nor any change to the standard upgrade mechanism.
Instead it provides an API on which module_auto_update can build,
as well as a method which can be called from a script to run
the upgrade of modules for which the checksum has changed.

* [IMP] refactor module_auto_update

Make it depend on module_checksum_upgrade which provides
the core mechanisms of managing the checksums. module_auto_update
makes it automatic.

* [IMP] module_checksum_upgrade: better exclusion mechanism

Ignore files based on exclude patterns.
Ignore uninstalled languages.
Better default for patterns to ignore (*.pyc,*.pyo,*.pot,static/*)

For better control on the hashing mechanism implement our own:
it's quite easy, and the checksumdir module used previously had
no test.

* [MIG] module_auto_update: adapt to new checksum mechanism

* [IMP] module_checksum_upgrade: raise in case of
 incomplete upgrade

* [IMP] module_checksum_upgrade: improve default exclusion
 pattern

* [IMP] module_checksum_upgrade: control translations
 overwrite

* [IMP] module_checksum_upgrade: one more test

* [IMP] module_checksum_upgrade: credits [ci skip]
2021-12-27 16:49:36 +02:00