Skip to content

pylint check is broken with astroid 2.12.12 #2334

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

Closed
lmilbaum opened this issue Oct 19, 2022 · 11 comments
Closed

pylint check is broken with astroid 2.12.12 #2334

lmilbaum opened this issue Oct 19, 2022 · 11 comments

Comments

@lmilbaum
Copy link

lmilbaum commented Oct 19, 2022

tox -e pylint result:

************* Module gitlab.mixins
gitlab/mixins.py:121:19: E1102: self._obj_cls is not callable (not-callable)
gitlab/mixins.py:125:15: E1102: self._obj_cls is not callable (not-callable)
gitlab/mixins.py:158:15: E1102: self._obj_cls is not callable (not-callable)
gitlab/mixins.py:248:20: E1102: self._obj_cls is not callable (not-callable)
gitlab/mixins.py:304:15: E1102: self._obj_cls is not callable (not-callable)
gitlab/mixins.py:405:15: E1102: self._obj_cls is not callable (not-callable)


Your code has been rated at 9.94/10 (previous run: 10.00/10, -0.06)

@nejch
Copy link
Member

nejch commented Oct 19, 2022

Hmm, really really odd that this passes in CI.

We have a TYPE_CHECKING guard here for mypy with an is not None assert, but pylint ignores that for its own type checks.

@nejch
Copy link
Member

nejch commented Oct 19, 2022

I see a bunch of false-positive issues reported on pylint about this, so it just seems to struggle with this. But also I'm confused why it works on CI 😁

@lmilbaum
Copy link
Author

It is failing in CI

@nejch
Copy link
Member

nejch commented Oct 19, 2022

Ah, good. I was referring to https://github.com/python-gitlab/python-gitlab/actions/runs/3276883032/jobs/5393461110, from main, which should have failed.

But I suspect there was an update in a transitive dependency that we do not track/freeze, that changed the behavior then.

@nejch
Copy link
Member

nejch commented Oct 19, 2022

- pylint develop-inst-noop: /home/runner/work/python-gitlab/python-gitlab
- pylint installed: argcomplete==2.0.0,astroid==2.12.11,attrs==22.1.0,black==22.10.0,certifi==2022.9.24,charset-normalizer==2.1.1,click==8.1.3,colorama==0.4.5,commitizen==2.35.0,decli==0.5.2,dill==0.3.5.1,flake8==5.0.4,idna==3.4,iniconfig==1.1.1,isort==5.10.1,Jinja2==3.1.2,lazy-object-proxy==1.7.1,MarkupSafe==2.1.1,mccabe==0.7.0,mypy==0.981,mypy-extensions==0.4.3,packaging==21.3,pathspec==0.10.1,platformdirs==2.5.2,pluggy==1.0.0,prompt-toolkit==3.0.31,py==1.11.0,pycodestyle==2.9.1,pyflakes==2.5.0,pylint==2.15.3,pyparsing==3.0.9,pytest==7.1.3,-e git+https://github.com/python-gitlab/python-gitlab@dd04e8ef7eee2793fba38a1eec019b00b3bb616e#egg=python_gitlab,PyYAML==6.0,questionary==1.10.0,requests==2.28.1,requests-toolbelt==0.10.0,termcolor==2.0.1,tomli==2.0.1,tomlkit==0.11.5,types-PyYAML==6.0.12,types-requests==2.28.11.2,types-setuptools==64.0.1,types-urllib3==1.26.25.1,typing_extensions==4.4.0,urllib3==1.26.12,wcwidth==0.2.5,wrapt==1.14.1
- pylint run-test-pre: PYTHONHASHSEED='3036645161'
+ pylint develop-inst-noop: /home/runner/work/python-gitlab/python-gitlab
+ pylint installed: argcomplete==2.0.0,astroid==2.12.12,attrs==22.1.0,black==22.10.0,certifi==2022.9.24,charset-normalizer==2.1.1,click==8.1.3,colorama==0.4.5,commitizen==2.35.0,decli==0.5.2,dill==0.3.5.1,flake8==5.0.4,idna==3.4,iniconfig==1.1.1,isort==5.10.1,Jinja2==3.1.2,lazy-object-proxy==1.7.1,MarkupSafe==2.1.1,mccabe==0.7.0,mypy==0.981,mypy-extensions==0.4.3,packaging==21.3,pathspec==0.10.1,platformdirs==2.5.2,pluggy==1.0.0,prompt-toolkit==3.0.31,py==1.11.0,pycodestyle==2.9.1,pyflakes==2.5.0,pylint==2.15.3,pyparsing==3.0.9,pytest==7.1.3,-e git+https://github.com/python-gitlab/python-gitlab@3a5d0779c469066b5d58c4296e6885973518072a#egg=python_gitlab,PyYAML==6.0,questionary==1.10.0,requests==2.28.1,requests-toolbelt==0.10.0,termcolor==2.0.1,tomli==2.0.1,tomlkit==0.11.5,types-PyYAML==6.0.12,types-requests==2.28.11.2,types-setuptools==64.0.1,types-urllib3==1.26.25.1,typing_extensions==4.4.0,urllib3==1.26.12,wcwidth==0.2.5,wrapt==1.14.1
+ pylint run-test-pre: PYTHONHASHSEED='2208336539'

I'll say it's probably because of astroid, bumped from 2.12.11 to 2.12.12, as that does type inference for pylint IIRC. Could you pin that to .11 and try again @lmilbaum?

@lmilbaum
Copy link
Author

Same result in my DEV environment. Checking in CI.

@lmilbaum
Copy link
Author

Same result in CI

@lmilbaum
Copy link
Author

I pinned it to .12 which is the green one in your comment

@nejch
Copy link
Member

nejch commented Oct 19, 2022

Ah, sorry @lmilbaum. I wasn't very clear on that. The diff was from old to new looking at the logs in the CI runner. Downgrading to .11 should fix it IMO, as the .12 release was a few hours ago. https://github.com/PyCQA/astroid/releases/tag/v2.12.12

@lmilbaum
Copy link
Author

Fixed. BTW, are those errors reporting a real issue which needs to be addressed or is it a false positive situation? The question is a followup on your comment in the PR. Just to figure out if we want to track this issue.

@nejch
Copy link
Member

nejch commented Oct 19, 2022

I think it may be an issue for type checkers, not for runtime. It was already caught by mypy which probably does a better job at type checking, and we've added if TYPE_CHECKING: guards for that reason there already.

Maybe there's another way to fix that. I'd say we can keep this open to track it, but with very low priority from my perspective :)

@nejch nejch changed the title pylint check is broken pylint check is broken with astroid 2.12.12 Oct 19, 2022
@nejch nejch closed this as completed in f0c02a5 Oct 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants