chilly-tailor-75063
11/04/2022, 8:34 PMNo name 'BaseModel' in module 'pydantic' (no-name-in-module)
from pylint in my project, but I’m having no luck. No change to my pyproject.toml or pants.toml or .pylintrc file seems to make any difference.
Got any suggestions where to look? To be honest I’m not sure pylint is using my .pylintrc file… 😞polite-garden-50641
11/04/2022, 8:54 PM[pylint].extra_requirements
option.witty-crayon-22786
11/04/2022, 9:09 PM./pants dependencies $file_in_question
actually shows pydantic
(matching your import
statement)… if it doesn’t, then Pants won’t know to put it in the sandboxchilly-tailor-75063
11/04/2022, 9:19 PM[pylint]
PANTS_PYLINT_CONFIG = "config/.pylintrc"
When I run ./pants lint ::
I get this:
17:17:07.90 [INFO] Initializing scheduler...
17:17:08.06 [INFO] Scheduler initialized.
17:17:08.08 [ERROR] Invalid option 'PANTS_PYLINT_CONFIG' under [pylint] in /Users/dfarrell/projects/rh/recurring-payment/pants.toml
17:17:08.08 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
witty-crayon-22786
11/04/2022, 10:38 PMDo I need to do something explicit to add pydantic?if you have an explicit
import
of pydantic, then yes…
if you do not have an explicit import
of pydantic, and it is instead a transitive dependency, then no: it should be added to the sandbox for pylint
automatically, because pylint
uses the transitive dependencies of your codehappy-kitchen-89482
11/05/2022, 12:11 AMPANTS_PYLINT_CONFIG
is how you would set that option as an env var. You want
[pylint]
config = "config/.pylintrc"
chilly-tailor-75063
11/06/2022, 4:17 PM[pylint]
config = "config/.pylintrc"
To my `pants.toml file, and it seems to be reading the file, but I’m still getting
R0903: Too few public methods (0/2) (too-few-public-methods)
errors from my files even though I have
disable=too-few-public-methods
In my .pylintrc
file. 😞disable=R0903
instead of using the name, that works! Are the names (too-few-public-methods) broken in some way?happy-kitchen-89482
11/06/2022, 4:52 PMchilly-tailor-75063
11/07/2022, 2:21 PM