diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 16009aa6fe..0000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,8 +0,0 @@ -languages: - JavaScript: true - Python: true -exclude_paths: - - "__unported__/*" - - "*/__openerp__.py" # because this is fed to eval - - "*/__manifest__.py" - - "*/migrations/*" # without OpenUpgrade, repetitions can be necessary diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000000..2246d02358 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,13 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: v1.0.3 +_src_path: gh:oca/oca-addons-repo-template +dependency_installation_mode: PIP +generate_requirements_txt: true +include_wkhtmltopdf: false +odoo_version: 14.0 +rebel_module_groups: [] +repo_description: "TODO: add repo description." +repo_name: queue +repo_slug: queue +travis_apt_packages: [] +travis_apt_sources: [] diff --git a/.gitignore b/.gitignore index 5e48466dc5..818770fb1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +/.venv +/.pytest_cache # C extensions *.so @@ -41,6 +43,19 @@ coverage.xml # Pycharm .idea +# Eclipse +.settings + +# Visual Studio cache/options directory +.vs/ +.vscode + +# OSX Files +.DS_Store + +# Django stuff: +*.log + # Mr Developer .mr.developer.cfg .project @@ -56,5 +71,5 @@ docs/_build/ *~ *.swp -# OSX Files -*.DS_Store +# OCA rules +!static/lib/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37b0c97282..39468209d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,14 @@ exclude: | (?x) + # NOT INSTALLABLE ADDONS + ^base_export_async/| + ^base_import_async/| + ^queue_job/| + ^queue_job_cron/| + ^queue_job_subscribe/| + ^test_base_import_async/| + ^test_queue_job/| + # END NOT INSTALLABLE ADDONS # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| # Maybe reactivate this when all README files include prettier ignore tags? @@ -9,33 +18,48 @@ exclude: | # Repos using Sphinx to generate docs don't need prettying ^docs/_templates/.*\.html$| # You don't usually want a bot to modify your legal texts - (LICENSE.*|COPYING.*)| - ^base_export_async/ + (LICENSE.*|COPYING.*) default_language_version: python: python3 node: "14.13.0" repos: + - repo: local + hooks: + # These files are most likely copier diff rejection junks; if found, + # review them manually, fix the problem (if needed) and remove them + - id: forbidden-files + name: forbidden files + entry: found forbidden files; remove them + language: fail + files: "\\.rej$" + - repo: https://github.com/oca/maintainer-tools + rev: 1b5c7ad + hooks: + # update the NOT INSTALLABLE ADDONS section above + - id: oca-update-pre-commit-excluded-addons + - id: oca-fix-manifest-website + args: ["https://github.com/OCA/queue"] + - repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + args: ["-i", "--ignore-init-module-imports"] - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black - repo: https://github.com/prettier/pre-commit - rev: "v1.19.1" - hooks: - - id: prettier - # TODO Avoid awebdeveloper/pre-commit-prettier if possible - # HACK https://github.com/prettier/prettier/issues/7407 - - repo: https://github.com/awebdeveloper/pre-commit-prettier - rev: v0.0.1 + rev: v2.1.2 hooks: - id: prettier - name: prettier xml plugin + name: prettier + plugin-xml additional_dependencies: - - "prettier@1.19.1" - - "@prettier/plugin-xml@0.7.2" - files: \.xml$ + - "prettier@2.1.2" + - "@prettier/plugin-xml@0.12.0" + args: + - --plugin=@prettier/plugin-xml - repo: https://github.com/pre-commit/mirrors-eslint - rev: v6.8.0 + rev: v7.8.1 hooks: - id: eslint verbose: true @@ -43,7 +67,7 @@ repos: - --color - --fix - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v3.2.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -64,41 +88,53 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + - repo: https://github.com/asottile/pyupgrade + rev: v2.7.2 + hooks: + - id: pyupgrade + - repo: https://github.com/PyCQA/isort + rev: 5.5.1 + hooks: + - id: isort + name: isort except __init__.py + args: + - --settings=. + exclude: /__init__\.py$ + - repo: https://github.com/acsone/setuptools-odoo + rev: 2.6.0 + hooks: + - id: setuptools-odoo-make-default + - id: setuptools-odoo-get-requirements + args: + - --output + - requirements.txt + - --header + - "# generated from manifests external_dependencies" + - repo: https://gitlab.com/PyCQA/flake8 + rev: 3.8.3 hooks: - id: flake8 name: flake8 except __init__.py exclude: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] + additional_dependencies: ["flake8-bugbear==20.1.4"] - id: flake8 name: flake8 only __init__.py args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py files: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - repo: https://github.com/pre-commit/mirrors-pylint - rev: v2.5.3 + additional_dependencies: ["flake8-bugbear==20.1.4"] + - repo: https://github.com/PyCQA/pylint + rev: pylint-2.5.3 hooks: - id: pylint name: pylint with optional checks - args: ["--rcfile=.pylintrc", "--exit-zero"] + args: + - --rcfile=.pylintrc + - --exit-zero verbose: true - additional_dependencies: ["pylint-odoo==3.5.0"] + additional_dependencies: &pylint_deps + - pylint-odoo==3.5.0 - id: pylint name: pylint with mandatory checks - args: ["--rcfile=.pylintrc-mandatory"] - additional_dependencies: ["pylint-odoo==3.5.0"] - - repo: https://github.com/asottile/pyupgrade - rev: v1.26.2 - hooks: - - id: pyupgrade - - repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 - hooks: - - id: isort - name: isort except __init__.py - exclude: /__init__\.py$ - - repo: https://github.com/acsone/setuptools-odoo - rev: 2.5.2 - hooks: - - id: setuptools-odoo-make-default + args: + - --rcfile=.pylintrc-mandatory + additional_dependencies: *pylint_deps diff --git a/.prettierrc.yml b/.prettierrc.yml index fc5f3a7c4d..5b6d4b361a 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -5,4 +5,4 @@ printWidth: 88 proseWrap: always semi: true trailingComma: "es5" -xmlWhitespaceSensitivity: "ignore" +xmlWhitespaceSensitivity: "strict" diff --git a/.pylintrc b/.pylintrc index 485836baf4..e33958833e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -8,7 +8,7 @@ manifest_required_authors=Odoo Community Association (OCA) manifest_required_keys=license manifest_deprecated_keys=description,active license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 -valid_odoo_versions=13.0 +valid_odoo_versions=14.0 [MESSAGES CONTROL] disable=all @@ -46,8 +46,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, @@ -73,6 +71,7 @@ enable=anomalous-backslash-in-string, deprecated-module, file-not-used, invalid-commit, + missing-manifest-dependency, missing-newline-extrafiles, missing-readme, no-utf8-coding-comment, @@ -82,6 +81,7 @@ enable=anomalous-backslash-in-string, too-complex, unnecessary-utf8-coding-comment + [REPORTS] msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} output-format=colorized diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 55893fe8b6..08bca3cefe 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -8,7 +8,7 @@ manifest_required_authors=Odoo Community Association (OCA) manifest_required_keys=license manifest_deprecated_keys=description,active license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 -valid_odoo_versions=13.0 +valid_odoo_versions=14.0 [MESSAGES CONTROL] disable=all @@ -39,8 +39,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, diff --git a/.travis.yml b/.travis.yml index 6716bfaded..4b5ed106df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,20 +21,20 @@ jobs: include: - stage: linting name: "pre-commit" - before_install: install: pip install pre-commit script: pre-commit run --all --show-diff-on-failure --verbose --color always after_success: + before_install: - stage: test env: - - TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1" + - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" - stage: test env: - - TESTS="1" ODOO_REPO="OCA/OCB" - + - TESTS=1 ODOO_REPO="OCA/OCB" env: global: - - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - MQT_DEP=PIP install: - git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba44a40790..9ac71fee42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,4 +5,6 @@ Please follow the official guide from the ## Project Specific Guidelines + + This project does not have specific coding guidelines. diff --git a/LICENSE b/LICENSE index 58777e31af..be3f7b28e5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ -GNU AFFERO GENERAL PUBLIC LICENSE + GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -658,4 +658,4 @@ specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see -. +. diff --git a/README.md b/README.md index bde3f0a011..4ddc34540f 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,36 @@ -[![Build Status](https://travis-ci.org/OCA/queue.svg?branch=13.0)](https://travis-ci.org/OCA/queue) -[![codecov](https://codecov.io/gh/OCA/queue/branch/13.0/graph/badge.svg)](https://codecov.io/gh/OCA/queue) +[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/230/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-queue-230) +[![Build Status](https://travis-ci.com/OCA/queue.svg?branch=14.0)](https://travis-ci.com/OCA/queue) +[![codecov](https://codecov.io/gh/OCA/queue/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/queue) +[![Translation Status](https://translation.odoo-community.org/widgets/queue-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/queue-14-0/?utm_source=widget) + -Odoo Queue Modules -================== +# queue -Asynchronous Job Queue. Delay Model methods in asynchronous jobs, executed in -the background as soon as possible or on a schedule. Support Channels to -segregates jobs in different queues with different capacities. Unlike -scheduled tasks, a job captures arguments for later processing. +TODO: add repo description. + + +[//]: # (addons) -Translation Status ------------------- -[![Transifex Status](https://www.transifex.com/projects/p/OCA-queue-13-0/chart/image_png)](https://www.transifex.com/projects/p/OCA-queue-13-0) +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. + +[//]: # (end addons) + + + +## Licenses + +This repository is licensed under [AGPL-3.0](LICENSE). + +However, each module can have a totally different license, as long as they adhere to OCA +policy. Consult each module's `__manifest__.py` file, which contains a `license` key +that explains its license. + +---- + +OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit +organization whose mission is to support the collaborative development of Odoo features +and promote its widespread use. diff --git a/base_import_async/__manifest__.py b/base_import_async/__manifest__.py index fb41d9f901..35901ecc46 100644 --- a/base_import_async/__manifest__.py +++ b/base_import_async/__manifest__.py @@ -13,6 +13,6 @@ "depends": ["base_import", "queue_job"], "data": ["data/queue_job_function_data.xml", "views/base_import_async.xml"], "qweb": ["static/src/xml/import.xml"], - "installable": True, + "installable": False, "development_status": "Production/Stable", } diff --git a/oca_dependencies.txt b/oca_dependencies.txt index ac0117d109..ca3c726ba2 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,15 +1 @@ -# List the OCA project dependencies, one per line -# Add a repository url and branch if you need a forked version -# -# Examples -# ======== -# -# To depend on the standard version of sale-workflow, use: -# sale-workflow -# -# To explicitely give the URL of a fork, and still use the version specified in -# .travis.yml, use: -# sale-workflow https://github.com/OCA/sale-workflow -# -# To provide both the URL and a branch, use: -# sale-workflow https://github.com/OCA/sale-workflow branchname +# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 537db47cd0..0b1d16e56e 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -17,7 +17,7 @@ "data/queue_data.xml", "data/queue_job_function_data.xml", ], - "installable": True, + "installable": False, "development_status": "Mature", "maintainers": ["guewen"], "post_init_hook": "post_init_hook", diff --git a/queue_job_cron/__manifest__.py b/queue_job_cron/__manifest__.py index 9cfcefae64..4379e830f6 100644 --- a/queue_job_cron/__manifest__.py +++ b/queue_job_cron/__manifest__.py @@ -10,5 +10,5 @@ "category": "Generic Modules", "depends": ["queue_job"], "data": ["data/data.xml", "views/ir_cron_view.xml"], - "installable": True, + "installable": False, } diff --git a/queue_job_subscribe/__manifest__.py b/queue_job_subscribe/__manifest__.py index 839f484c7c..7223a50293 100644 --- a/queue_job_subscribe/__manifest__.py +++ b/queue_job_subscribe/__manifest__.py @@ -10,5 +10,5 @@ "category": "Generic Modules", "depends": ["queue_job"], "data": ["views/res_users_view.xml"], - "installable": True, + "installable": False, } diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt deleted file mode 100644 index f65b1dcb7e..0000000000 --- a/setup/_metapackage/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -13.0.20200110.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py deleted file mode 100644 index 3bbe8523d8..0000000000 --- a/setup/_metapackage/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -import setuptools - -with open('VERSION.txt', 'r') as f: - version = f.read().strip() - -setuptools.setup( - name="odoo13-addons-oca-queue", - description="Meta package for oca-queue Odoo addons", - version=version, - install_requires=[ - 'odoo13-addon-base_import_async', - 'odoo13-addon-queue_job', - 'odoo13-addon-queue_job_cron', - 'odoo13-addon-queue_job_subscribe', - 'odoo13-addon-test_base_import_async', - 'odoo13-addon-test_queue_job', - ], - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Odoo', - ] -) diff --git a/setup/base_import_async/odoo/addons/base_import_async b/setup/base_import_async/odoo/addons/base_import_async deleted file mode 120000 index 0a110e42a8..0000000000 --- a/setup/base_import_async/odoo/addons/base_import_async +++ /dev/null @@ -1 +0,0 @@ -../../../../base_import_async \ No newline at end of file diff --git a/setup/base_import_async/setup.py b/setup/base_import_async/setup.py deleted file mode 100644 index 28c57bb640..0000000000 --- a/setup/base_import_async/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/setup/queue_job/odoo/addons/queue_job b/setup/queue_job/odoo/addons/queue_job deleted file mode 120000 index ac796aaa1c..0000000000 --- a/setup/queue_job/odoo/addons/queue_job +++ /dev/null @@ -1 +0,0 @@ -../../../../queue_job \ No newline at end of file diff --git a/setup/queue_job/setup.py b/setup/queue_job/setup.py deleted file mode 100644 index 28c57bb640..0000000000 --- a/setup/queue_job/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/setup/queue_job_cron/odoo/addons/queue_job_cron b/setup/queue_job_cron/odoo/addons/queue_job_cron deleted file mode 120000 index f5adafb380..0000000000 --- a/setup/queue_job_cron/odoo/addons/queue_job_cron +++ /dev/null @@ -1 +0,0 @@ -../../../../queue_job_cron \ No newline at end of file diff --git a/setup/queue_job_cron/setup.py b/setup/queue_job_cron/setup.py deleted file mode 100644 index 28c57bb640..0000000000 --- a/setup/queue_job_cron/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/setup/queue_job_subscribe/odoo/addons/queue_job_subscribe b/setup/queue_job_subscribe/odoo/addons/queue_job_subscribe deleted file mode 120000 index 9e74ed8ad2..0000000000 --- a/setup/queue_job_subscribe/odoo/addons/queue_job_subscribe +++ /dev/null @@ -1 +0,0 @@ -../../../../queue_job_subscribe \ No newline at end of file diff --git a/setup/queue_job_subscribe/setup.py b/setup/queue_job_subscribe/setup.py deleted file mode 100644 index 28c57bb640..0000000000 --- a/setup/queue_job_subscribe/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/setup/test_base_import_async/odoo/addons/test_base_import_async b/setup/test_base_import_async/odoo/addons/test_base_import_async deleted file mode 120000 index 1da8a69c67..0000000000 --- a/setup/test_base_import_async/odoo/addons/test_base_import_async +++ /dev/null @@ -1 +0,0 @@ -../../../../test_base_import_async \ No newline at end of file diff --git a/setup/test_base_import_async/setup.py b/setup/test_base_import_async/setup.py deleted file mode 100644 index 28c57bb640..0000000000 --- a/setup/test_base_import_async/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/setup/test_queue_job/odoo/addons/test_queue_job b/setup/test_queue_job/odoo/addons/test_queue_job deleted file mode 120000 index 0473d5583c..0000000000 --- a/setup/test_queue_job/odoo/addons/test_queue_job +++ /dev/null @@ -1 +0,0 @@ -../../../../test_queue_job \ No newline at end of file diff --git a/setup/test_queue_job/setup.py b/setup/test_queue_job/setup.py deleted file mode 100644 index 28c57bb640..0000000000 --- a/setup/test_queue_job/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/test_base_import_async/__manifest__.py b/test_base_import_async/__manifest__.py index 69a3712c31..5e0bfd6968 100644 --- a/test_base_import_async/__manifest__.py +++ b/test_base_import_async/__manifest__.py @@ -15,6 +15,6 @@ """, "depends": ["base_import_async", "account"], "data": [], - "installable": True, + "installable": False, "development_status": "Production/Stable", } diff --git a/test_queue_job/__manifest__.py b/test_queue_job/__manifest__.py index c116362ff3..a09c89b07f 100644 --- a/test_queue_job/__manifest__.py +++ b/test_queue_job/__manifest__.py @@ -14,5 +14,5 @@ "data/queue_job_function_data.xml", "security/ir.model.access.csv", ], - "installable": True, + "installable": False, }