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 bbdb94a commit a6a90f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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 a6a90f6

Please sign in to comment.