Open bdrung opened 2 years ago
Thanks for the report. Fixed in PyCQA/astroid#1536, which will be part of pylint 2.15's upgrade to astroid 2.12. This may even be a duplicate of #2648 but I'm reluctant to declare that until we have distilled a mergeable test case from it.
This issue has a clear test case, which I would welcome adding to the suite. Would you like to prepare a PR? It will pass as soon as we merge #7153.
Because this issue requires a particular directory structure, and might not reproduce cleanly with the generic system for functional tests in tests/functional, you might follow the models at #7117 or #7113.
I spent most of my weekend debugging a similar issue. The project root (with requirements.txt) is named django
. I kept getting import errors on django
, but all the other modules were detected just fine.
Can you confirm this will be fixed in 2.15.0? Also, is there a date announced for 2.15.0 or a workaround until that time?
Can you confirm this will be fixed in 2.15.0?
The cases reported to this issue board relating to imports can be deceivingly different. It would be a great help if you could install pylint from the main
branch with pip install git+https://github.com/PyCQA/pylint.git
and let us know if it resolves your issue. That install should pull astroid==2.12.2
.
Also, is there a date announced for 2.15.0 or a workaround until that time?
Unfortunately not, the workaround is to install from the main branch as above.
You can follow the release at https://github.com/PyCQA/pylint/milestone/56. I'm going to remove this from the 2.15.0 milestone as we want to release soon and as if seems like a real release would be convenient be helpful for testing on your side :)
Still reproduces on pylint at 1baa10e250406d740d0c83f2902e949d84c1ecd8 and astroid at 39d9cafb8b39432957f4e640d5ef222b66a7096e, so https://github.com/PyCQA/pylint/issues/7093#issuecomment-1183091900 was not correct.
Bug description
Apport provides a module name
apport
, but also a script nameddata/apport
. Pylint throws a bunch of failures fordata/apport
. This problem can be reproduces with this Shell script:It will create
name/math.py
withand
data/name
withAfter setting
PYTHONPATH
,data/name
will execute successfully.Configuration
No response
Command used
or
or
Pylint output
Expected behavior
pylint should produce no output.
Pylint version
OS / Environment
Ubuntu 22.04 (jammy)
Additional dependencies
No response