Skip to content

Commit

Permalink
[FIX] Hard-specify Python versions in pre-commit for Odoo <=12
Browse files Browse the repository at this point in the history
The flake8 version used by these Odoo versions does not work with more
recent versions of Python.

Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed Mar 30, 2022
1 parent 8bb6e5a commit 33efe3c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ jobs:
- 3.6
- 3.8
odoo-version:
- 10.0
- 11.0
- 12.0
- 13.0
- 14.0
- 15.0
include:
- python-version: 2.7
odoo-version: 10.0
exclude:
- python-version: 3.8
odoo-version: 11.0
- python-version: 3.8
odoo-version: 12.0
steps:
# Prepare environment
- uses: actions/checkout@v2.3.3
Expand Down
7 changes: 7 additions & 0 deletions src/.github/workflows/pre-commit.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
{%- if 10 < odoo_version < 13 %}
with:
python-version: "3.6"
{%- elif odoo_version <= 10 %}
with:
python-version: "2.7"
{%- endif %}
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
Expand Down
2 changes: 1 addition & 1 deletion version-specific/mqt-compat/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
rev: v3.4.1
hooks:
- id: flake8
language_version: python{% if odoo_version < 11 %}2{% else %}3{% endif %}
language_version: python{% if odoo_version < 11 %}2{% else %}3.6{% endif %}
name: flake8 excluding __init__.py
exclude: __init__\.py
- repo: https://github.com/pre-commit/mirrors-pylint
Expand Down

0 comments on commit 33efe3c

Please sign in to comment.