Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] Add option for Odoo 17.0 #425

Merged
merged 10 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .flake8

This file was deleted.

1 change: 0 additions & 1 deletion .flake8.jinja

This file was deleted.

10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ jobs:
- "3.10"
- 3.11
odoo-version:
- 7.0
- 8.0
- 9.0
- 10.0
- 11.0
- 12.0
- 13.0
- 14.0
- 15.0
- 16.0
include:
- python-version: "3.10"
odoo-version: 17.0
- python-version: 3.11
odoo-version: 17.0

steps:
# Shared steps
- uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .isort.cfg.jinja

This file was deleted.

20 changes: 6 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,25 @@ repos:
entry: found forbidden files; remove them
language: fail
files: "\\.rej$"
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: black
additional_dependencies: ["click<8.1.0"]
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args:
- --keep-percent-format
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==23.7.10", "importlib-metadata<6.8.0"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
hooks:
- id: prettier
args: [--ignore-unknown]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
40 changes: 9 additions & 31 deletions .pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

{%- if odoo_version < 16 %}
{%- set proj_rev.pylint_odoo = "v8.0.0" %}
{%- else %}
{%- elif odoo_version < 17 %}
{%- set proj_rev.pylint_odoo = "v8.0.20" %}
{%- else %}
{%- set proj_rev.pylint_odoo = "v9.0.4" %}
{%- endif -%}

exclude: |
Expand Down Expand Up @@ -62,24 +64,18 @@ repos:
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: black
additional_dependencies: ["click<=8.1.7"]
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args:
- --keep-percent-format
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: isort except __init__.py
args: [--settings, .]
exclude: /__init__\.py$
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
hooks:
Expand All @@ -90,7 +86,7 @@ repos:
- [email protected]
- "@prettier/[email protected]"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -111,24 +107,6 @@ repos:
- id: check-xml
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
name: flake8 except __init__.py, __manifest__.py
args: ["--extend-ignore=B023"]
exclude: /__(?:init|manifest)__\.py$
additional_dependencies: ["flake8-bugbear==23.7.10", "importlib-metadata<=6.8.0"]
- id: flake8
name: flake8 only __init__.py
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
files: /__init__\.py$
additional_dependencies: ["flake8-bugbear==23.7.10", "importlib-metadata<=6.8.0"]
- id: flake8
name: flake8 only __manifest__.py
args: ["--extend-ignore=B018"] # ignore found useless expression in __manifest__.py
files: /__manifest__\.py$
additional_dependencies: ["flake8-bugbear==23.7.10", "importlib-metadata<=6.8.0"]
- repo: https://github.com/OCA/pylint-odoo
rev: {{ proj_rev.pylint_odoo }}
hooks:
Expand Down
29 changes: 29 additions & 0 deletions .ruff.toml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
target-version = "py310"
fix = true

[lint]
extend-select = [
"B",
"C90",
"E501", # line too long (default 88)
"I", # isort
"UP", # pyupgrade
]
exclude = ["setup/*"]

[format]
exclude = ["setup/*"]

[per-file-ignores]
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
"__manifest__.py" = ["B018"] # useless expression

[isort]
section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"]

[isort.sections]
"odoo" = ["odoo"]
"odoo-addons" = ["odoo.addons"]

[mccabe]
max-complexity = 16
13 changes: 3 additions & 10 deletions copier.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# Configure jinja2 defaults to make syntax highlighters lives easier
_templates_suffix: .jinja
_envops:
pedrobaeza marked this conversation as resolved.
Show resolved Hide resolved
block_end_string: "%}"
block_start_string: "{%"
comment_end_string: "#}"
comment_start_string: "{#"
keep_trailing_newline: true
variable_end_string: "}}"
variable_start_string: "{{"

# Other Copier configurations
_min_copier_version: "8.3.0"
_min_copier_version: "9"
_exclude:
- _macros
- _traefik*_labels.yml
Expand Down Expand Up @@ -107,7 +99,7 @@ _migrations:
odoo_version:
help: On which odoo version is it based?
type: float
default: 16.0
default: 17.0
choices:
- 7.0
- 8.0
Expand All @@ -119,6 +111,7 @@ odoo_version:
- 14.0
- 15.0
- 16.0
- 17.0

odoo_proxy:
default: traefik
Expand Down
Loading