# HG changeset patch # User Etienne Ferriere <etienne.ferriere@xcg-consulting.fr> # Date 1733842280 -3600 # Tue Dec 10 15:51:20 2024 +0100 # Branch 13.0 # Node ID 9cca3534b24da4be4b165dec14be766e58afaa3b # Parent d940cb24f4eeb8df313e5a3366208995f00ff348 Update project following template update, fix flake8 errors, package the module. diff --git a/.badges/code_style-black-000000.svg b/.badges/code_style-black-000000.svg new file mode 100644 --- /dev/null +++ b/.badges/code_style-black-000000.svg @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<svg xmlns="http://www.w3.org/2000/svg" width="114" height="20"> + <linearGradient id="b" x2="0" y2="100%"> + <stop offset="0" stop-color="#bbb" stop-opacity=".1" /> + <stop offset="1" stop-opacity=".1" /> + </linearGradient> + <mask id="anybadge_1"> + <rect width="114" height="20" rx="3" fill="#fff" /> + </mask> + <g mask="url(#anybadge_1)"> + <path fill="#555" d="M0 0h72v20H0z" /> + <path fill="#000000" d="M72 0h42v20H72z" /> + <path fill="url(#b)" d="M0 0h114v20H0z" /> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="37.0" y="15" fill="#010101" fill-opacity=".3">code style</text> + <text x="36.0" y="14">code style</text> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="94.0" y="15" fill="#010101" fill-opacity=".3">black</text> + <text x="93.0" y="14">black</text> + </g> +</svg> diff --git a/.badges/code_style-prettier-ff69b4.svg b/.badges/code_style-prettier-ff69b4.svg new file mode 100644 --- /dev/null +++ b/.badges/code_style-prettier-ff69b4.svg @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<svg xmlns="http://www.w3.org/2000/svg" width="129" height="20"> + <linearGradient id="b" x2="0" y2="100%"> + <stop offset="0" stop-color="#bbb" stop-opacity=".1" /> + <stop offset="1" stop-opacity=".1" /> + </linearGradient> + <mask id="anybadge_1"> + <rect width="129" height="20" rx="3" fill="#fff" /> + </mask> + <g mask="url(#anybadge_1)"> + <path fill="#555" d="M0 0h72v20H0z" /> + <path fill="#ff69b4" d="M72 0h57v20H72z" /> + <path fill="url(#b)" d="M0 0h129v20H0z" /> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="37.0" y="15" fill="#010101" fill-opacity=".3">code style</text> + <text x="36.0" y="14">code style</text> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="101.5" y="15" fill="#010101" fill-opacity=".3">prettier</text> + <text x="100.5" y="14">prettier</text> + </g> +</svg> diff --git a/.badges/licence-AGPL--3-blue.svg b/.badges/licence-AGPL--3-blue.svg new file mode 100644 --- /dev/null +++ b/.badges/licence-AGPL--3-blue.svg @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<svg xmlns="http://www.w3.org/2000/svg" width="107" height="20"> + <linearGradient id="b" x2="0" y2="100%"> + <stop offset="0" stop-color="#bbb" stop-opacity=".1" /> + <stop offset="1" stop-opacity=".1" /> + </linearGradient> + <mask id="anybadge_1"> + <rect width="107" height="20" rx="3" fill="#fff" /> + </mask> + <g mask="url(#anybadge_1)"> + <path fill="#555" d="M0 0h53v20H0z" /> + <path fill="#0000FF" d="M53 0h54v20H53z" /> + <path fill="url(#b)" d="M0 0h107v20H0z" /> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="27.5" y="15" fill="#010101" fill-opacity=".3">licence</text> + <text x="26.5" y="14">licence</text> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="81.0" y="15" fill="#010101" fill-opacity=".3">AGPL-3</text> + <text x="80.0" y="14">AGPL-3</text> + </g> +</svg> diff --git a/.badges/maturity.svg b/.badges/maturity.svg new file mode 100644 --- /dev/null +++ b/.badges/maturity.svg @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<svg xmlns="http://www.w3.org/2000/svg" width="103" height="20"> + <linearGradient id="b" x2="0" y2="100%"> + <stop offset="0" stop-color="#bbb" stop-opacity=".1" /> + <stop offset="1" stop-opacity=".1" /> + </linearGradient> + <mask id="anybadge_1"> + <rect width="103" height="20" rx="3" fill="#fff" /> + </mask> + <g mask="url(#anybadge_1)"> + <path fill="#555" d="M0 0h61v20H0z" /> + <path fill="#e05d44" d="M61 0h42v20H61z" /> + <path fill="url(#b)" d="M0 0h103v20H0z" /> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="31.5" y="15" fill="#010101" fill-opacity=".3">maturity</text> + <text x="30.5" y="14">maturity</text> + </g> + <g + fill="#fff" + text-anchor="middle" + font-family="DejaVu Sans,Verdana,Geneva,sans-serif" + font-size="11" + > + <text x="83.0" y="15" fill="#010101" fill-opacity=".3">Alpha</text> + <text x="82.0" y="14">Alpha</text> + </g> +</svg> diff --git a/.editorconfig b/.editorconfig new file mode 100644 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# Configuration for known file extensions +[*.{css,htm,html,js,json,jsx,less,markdown,md,py,rst,sass,scss,toml,xml,yaml,yml}] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,yml,yaml,rst,markdown,md,toml}] +indent_size = 2 + +# Do not configure editor for libs +[{*/static/{lib,src/lib}/**}] +charset = unset +end_of_line = unset +indent_size = unset +indent_style = unset +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.flake8 b/.flake8 new file mode 100644 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +per-file-ignores= + __init__.py:F401 + __manifest__.py:B018 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,11 @@ include: - project: xcg/ci-templates file: /odoo/13.0/gitlab-ci.yaml + +variables: + CI_TEMPLATE_NO_INSTALL_MODULE: "" + +# Pylint does not like that the module is installed in a different path than odoo other addons +pylint: + variables: + CI_TEMPLATE_NO_INSTALL_MODULE: "no" diff --git a/.hgignore b/.hgignore new file mode 100644 --- /dev/null +++ b/.hgignore @@ -0,0 +1,4 @@ +syntax: glob +./doc/_build +./doc/autotodo +.project diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,8 @@ +# Defaults for all prettier-supported languages. +# Prettier will complete this with settings from .editorconfig file. +bracketSpacing: false +printWidth: 88 +proseWrap: always +semi: true +trailingComma: "es5" +xmlWhitespaceSensitivity: "ignore" diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,4 @@ +rules: + document-start: disable + indentation: + indent-sequences: true diff --git a/hooks.py b/hooks.py --- a/hooks.py +++ b/hooks.py @@ -43,23 +43,30 @@ def _extract( method, fileobj, - keywords={ - "N_": None, - "_": None, - "dgettext": (2,), - "dngettext": (2, 3), - "gettext": None, - "ngettext": (1, 2), - "npgettext": ((1, "c"), 2, 3), - "pgettext": ((1, "c"), 2), - "ugettext": None, - "ungettext": (1, 2), - }, - comment_tags=(), + keywords=None, + comment_tags=None, options=None, # strip tag by default strip_comment_tags=True, ): + + if keywords is None: + keywords = { + "N_": None, + "_": None, + "dgettext": (2,), + "dngettext": (2, 3), + "gettext": None, + "ngettext": (1, 2), + "npgettext": ((1, "c"), 2, 3), + "pgettext": ((1, "c"), 2), + "ugettext": None, + "ungettext": (1, 2), + } + + if comment_tags is None: + comment_tags = () + if method == "python": if __ICU_FORMAT_TRANSLATE not in keywords: keywords[__ICU_FORMAT_TRANSLATE] = (1,) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,92 @@ +[project] +name = "odoo-addon-icuformat" +dynamic = ["version"] +readme = "README.rst" +requires-python = "~=3.8" +license = { file = "LICENSE", name = "GNU Affero General Public License v3" } +keywords = ["odoo"] +authors = [{ name = "XCG Consulting" }] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Framework :: Odoo", + "Framework :: Odoo :: 13.0", + "License :: OSI Approved :: GNU Affero General Public License v3" +] +dependencies = ["odoo ==13.0.*"] + +[project.optional-dependencies] +doc = ["sphinx", "sphinx-odoo-autodoc", "odoo-scripts"] +test = [] + +[project.urls] +repository = "https://orus.io/xcg/odoo-modules/icuformat" +changelog = "https://orus.io/xcg/odoo-modules/icuformat/-/blob/branch/13.0/NEWS.rst" + +[build-system] +requires = ["hatchling >=1.19", "hatch-vcs"] +build-backend = "hatchling.build" + +[tool.hatch.build] +exclude = [ + "/doc/", + "/.editorconfig", + "/.eslintrc.yml", + "/.flake8", + "/.gitlab-ci.yml", + "/.hgignore", + "/.hgtags", + "/.prettierrc.yml", + "/.yamllint.yaml" +] + +[tool.hatch.build.targets.wheel] +include = [ + "*.csv", + "/i18n/", + "/static/", + "README.rst", + "*.xml", + "*.py", + "*.svg", + "*.png" +] + +[tool.hatch.build.targets.wheel.sources] +"" = "odoo/addons/icuformat" + +[tool.hatch.version] +source = "vcs" + +[tool.black] +line-length = 79 +target-version = ["py38"] +required-version = "19.3b0" + +[tool.isort] +py_version = 38 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +combine_as_imports = true +sections = [ + "FUTURE", + "STDLIB", + "SPECIAL_THIRD_PARTY", + "ODOO", + "ODOO_ADDONS", + "LOCALFOLDER", + "THIRDPARTY" +] +known_odoo = ["odoo"] +known_odoo_addons = ["odoo.addons"] +known_special_third_party = [ + "dateutil", + "lxml", + "mock", + "requests", + "minio", + "werkzeug" +] +default_section = "THIRDPARTY"