bug and false-positive: pylint blows up with implicit namespaces submodules with relative imports in src-layout in parallel mode #10147
Labels
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
Bug description
$sbj. It either tracebacks or produces false-positives depending on the settings + CLI args. I faced this when replacing a try-except ImportError with just an import in https://github.com/sphinx-contrib/sphinxcontrib-towncrier.git that has both an implicit namespace and an src layout.
When I tried adding
source-roots
, it was giving me more import-related errors which confused me and lead down the wrong rabbit hole. At some point, I realized thatsource-roots
does work (one of the complications was the lack of a correct usage example in the docs!), and proceeded bisecting other aspects of the project.Eventually, I ended up with a reproducer with no deps or config. It turned out that when
--jobs
is anything other than1
, pylint tracebacks somewhere inconcurrent.futures
. And it seems like depending on what path is passed via CLI, it may either dump that trace or show some import rule violation that is untrue.See the repro with the console logs below.
Configuration
N/A
Command used
Pylint output
Expected behavior
No false positives (
import-error
,no-name-in-module
,relative-beyond-top-level
seem to be caused by this bug) or tracebacks.Pylint version
OS / Environment
Only checked under GNU/Linux. It's Ubuntu that GHA provides and my laptop with Gentoo Linux. Python 3.9, 3.10, 3.11, 3.12. I haven't checked others, but I imagine it'd be the same.
Additional dependencies
None.
The text was updated successfully, but these errors were encountered: