-
Hi All- I ran a git bisect attempting to diagnose an error I began having recently with pylint. I have a set of proprietary modules, each of which has its own repo and pyproject.toml. There's a parent module which depends on all the others, and is also packaged as a conventional module with pyproject.toml. To simplify development, I use the scheme in which our modules appear twice in the pyproject dependencies list, where the second instance is "-e /path/to/the/cloned/repo" Prior to 04ace4a, I'd run pdm install and then pdm run pylint and all was well. After that commit though, everything continues to work properly except pylint, which throws "import-error" warnings for any of the import statements that refer to any of the modules which appear in the dependencies list with a path. Python itself is able to import any of those modules, pytest works fine, etc. If I modify the pyproject dependencies and exclude the "-e ..." entries, pylint behaves as expected. My suspicion is that the use of .pth files or the RedirectingFinder thingy is incompatible with how pylint tests whether imports are valid. I can squelch the import-error exception type, but would prefer not to if I can find a solution. Anyone discover a workaround for this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, many tools like linters and typecheckers can't discover modules hidden behind
|
Beta Was this translation helpful? Give feedback.
Yes, many tools like linters and typecheckers can't discover modules hidden behind
RedirectFinder
. The workarounds are:path
for all sub packages: https://pdm.fming.dev/pyproject/tool-pdm/#editable-build-backend