-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False positive circular dependency detection #9175
Comments
Thank you for the reproducer, it's hard to do anything with circular import otherwise :) my intuition would be something linked to import order (maybe similar to #6535?), but this definitely need investigations. |
With pylint update to version 3, some false positives related to cyclic imports have appeared. This is probaly related to pylint-dev/pylint#9175 We choose to ignore them in __init__.py files.
@Pierre-Sassoulas I'm not sure it's directly related. Just to clarify, I don't especially mind that |
Ha, my bad, it's working as intended then. (Similar to #9124). Still need to fix the inconsistencies though. |
@Pierre-Sassoulas from Python's perspective it's legal. So it should be ok. Anyway, I'm more bothered with the inconsistency of the detection and its resolution. |
Bug description
The code is given in this repository.
The detection root cause is the
Step
class definition. However, since we import the class first in the package's__init__.py
file, the import is not circular by Python's rules.We found 2 ways to solve it.
__init__.py
at the repository root level. Not sure why this makes the issue disappear.To summarize - there are 2 related issues here:
make test
.To reproduce the issue and show the 2 resolutions work, simply run
make verify_resolutions
in the repository.Related issue
Configuration
No response
Command used
pylint --recursive=y --disable=W,C0114,C0115,C0116,R0903 -s=n .
Pylint output
Expected behavior
__init__.py
at the repository root make the issue disappear.Pylint version
OS / Environment
Mac and Linux (both in a docker and in the host)
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: