I have one more question for today. I had my proje...
# general
c
I have one more question for today. I had my project working with all goals and all looked nice. I then added a dependency to a library (pydantic, but I don't think it matters) and the apps still run nicely, but the linting throws an error (No name 'BaseModel' in module 'pydantic'). I don't understand why would that happen, nor what to change to make it work again. Unfortunately, thins kind of issues are what make people anxious about trying a new tool, so I'd like to be prepared when I try to sell the idea to my team.
1
r
Have you added pydantic as 3rd party dependency so that pants can use it? I am using pydantic also and it works fine with pants.
c
yes, and I can the app just fine. Searching the net gives that it's a problem with pylint, so I guess it's all good for Pants.
r
ah ok. I use flake8 and hence hasn’t seen this issue.
b
Pylint FWIW existed pre type hints and so parses source code to try reeeeally hard to make type inferences. Sometimes it misses the mark 🙂 but for the time it actually did a great job. Nowadays I feel like mypy and other tools cover a large area, and would love to see a type-hint aware tool fill in the rest
c
For reference, this fixes the issue: (in pyproject.toml)
[tool.pylint.'MESSAGES CONTROL']
extension-pkg-whitelist = "pydantic"
👍 1
b
Ah yeah. Hard to parse source code when there is no source code 😂
h
huh, thanks for the update Vlad!