Closed shepilov-vladislav closed 5 years ago
We haven't faced these errors ever. If you don't put in context...
What is your python version, pylint, astroid and pylint-odoo? Could you share the minimal code to reproduce it, please?
odoo
is not in the environment. pylint_odoo
runs as a pre-commit hook which does not have access to a full odoo environment.
you can reproduce by using this: https://github.com/xoe-labs/dockery-odoo-scaffold
Steps (eg. in /tmp
): https://xoe-labs.github.io/dockery-odoo/
While it's not minimal, it's the environment to reproduce unless you have odoo
installed on your host machine.
EDIT: We had to disable several false positive: https://github.com/xoe-labs/dockery-odoo-scaffold/blob/master/.pylintrc#L56-L64 but the idea is not to turn off everything... :stuck_out_tongue_winking_eye:
@shepilov-vladislav specifically see also: https://github.com/xoe-labs/dockery-odoo-scaffold/blame/0c634238cc0675c166d76ffff06fde4b13efbc62/.pylintrc#L57
@blaggacao You are confusing “missing external dependency from manifest” vs “Import Error” are very different. The first one for pylint-odoo and the second one is a core check from pylint itself.
Then we won’t fix here And we don’t have enough information to reproduce the first one
@moylop260
sed '/You are confusing “missing external dependency from manifest” vs “Import Error” are very different. The first one for pylint-odoo and the second one is a core check from pylint itself./Why do you think they convolut?/'
Would be just a way more productive way to further the discussion...
But maybe you can explain why do you think this is closeable?
@moylop260
Why do you think they convolut?
I think they convolute, because I can imagine that odoo
not being in the environment, both checks give false positive resulting in complaining. If I'm right, that would be how they are "not so different".
Based on this maybe you (or @pedrobaeza) can enlighten us if there is a way to trick pylint
and pylint_odoo
into taking on a different environment in a git-commit hook.
Ultimately it's probably a wont-fix, but just maybe you have an idea how we can deal with this... :wink:
Could you check if the following comment fixes this one too, please?
Regards!
For what it's worth, nix-shell
is one very promising option to generate a predictable environment for this sort of tooling.