Closed yajo closed 2 years ago
Travis still is not supporting python3.10
So I can not set this version in CI in order to reproduce it and auto-tested
Could you check if it is working well without pylint-odoo (only pylint)?
So, it could be an issue in pylint project instead
By updating pylint, with this diff:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 980193e..24e38f7 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -98,7 +98,7 @@ repos:
files: /__init__\.py$
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/pycqa/pylint
- rev: pylint-2.5.3
+ rev: v2.12.2
hooks:
- id: pylint
name: pylint with optional checks
@@ -108,7 +108,7 @@ repos:
- --exit-zero
verbose: true
additional_dependencies:
- - isort==4.3.21
+ - isort==5.10.1
- pylint-odoo==3.6.0
- id: pylint
name: pylint with mandatory checks
@@ -116,7 +116,7 @@ repos:
- --valid_odoo_versions=14.0
- --rcfile=.pylintrc-mandatory
additional_dependencies:
- - isort==4.3.21
+ - isort==5.10.1
- pylint-odoo==3.6.0
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.8.1
I get this different error:
[INFO] Initializing environment for https://github.com/pycqa/pylint.
[INFO] Initializing environment for https://github.com/pycqa/pylint:isort==5.10.1,pylint-odoo==3.6.0.
[INFO] Installing environment for https://github.com/pycqa/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/var/home/yajo/.cache/pre-commit/repon21wux6m/py_env-python3/bin/python', '-mpip', 'install', '.', 'isort==5.10.1', 'pylint-odoo==3.6.0')
return code: 1
expected return code: 0
stdout:
Processing /var/home/yajo/.cache/pre-commit/repon21wux6m
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting isort==5.10.1
Using cached isort-5.10.1-py3-none-any.whl (103 kB)
Collecting pylint-odoo==3.6.0
Using cached pylint_odoo-3.6.0-py3-none-any.whl
Collecting rfc3986
Using cached rfc3986-2.0.0-py2.py3-none-any.whl (31 kB)
Collecting restructuredtext-lint==1.3.1
Using cached restructuredtext_lint-1.3.1-py3-none-any.whl
Collecting docutils==0.16
Using cached docutils-0.16-py2.py3-none-any.whl (548 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of isort to determine which version is compatible with other requirements. This could take a while.
The conflict is caused by:
The user requested pylint 2.12.2 (from /var/home/yajo/.cache/pre-commit/repon21wux6m)
pylint-odoo 3.6.0 depends on pylint==2.5.3; python_version >= "3"
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
stderr:
ERROR: Cannot install pylint 2.12.2 (from /var/home/yajo/.cache/pre-commit/repon21wux6m) and pylint-odoo==3.6.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Check the log at /var/home/yajo/.cache/pre-commit/pre-commit.log
Quoting from https://iscinumpy.dev/post/bound-version-constraints/ (go to the tl;dr of the tl;dr 😆):
Libraries/packages should be setting a floor, and if necessary excluding known buggy versions, but otherwise don’t cap the maximum version as you can’t predict future compatibility
So maybe we should just do that here and hope for the best. What do you think?
@yajo your solution at https://github.com/moduon/oca-addons-repo-template/commit/46b3b70ec0144b4fb047559b238001107c0be74d works for both old Pythons and new? Can be proposed to the main repo?
@yajo
Travis already enabled the py3.10 and even py3.11
I just have created the following PR:
FYI the CI is installing correctly the package for py3.10 even py3.11
Could you try using the hook of pylint-odoo directly instead of pylint, please?
More info:
@yajo
FYI now we are supporting 3.11 too from github actions:
Is your feature request related to a problem? Yes, https://github.com/OCA/oca-addons-repo-template/issues/80 when my local dev env uses python 3.10.
Describe the solution you'd like Add support for python 3.10.
Describe alternatives you've considered Disable this check, install a python 3.9 interpreter.
Additional context isort 5.10.0 added support to python 3.10.
If I apply this diff
It still fails: