Hi everyone, do I need to ignore `pants-plugins` f...
# general
r
Hi everyone, do I need to ignore
pants-plugins
folder in the repo for mypy?
Copy code
./pants check ::
14:51:09.96 [INFO] Completed: Building extra_type_stubs.pex
14:51:12.34 [INFO] Completed: Building mypy.pex from mypy_default_lockfile.txt
14:54:19.76 [INFO] Completed: Building requirements.pex with 23 requirements: PyYAML==6.0, SQLAlchemy==1.4.28, Unidecode==1.3.2, awswrangler==2.13.0, bcrypt, dynamic-yaml==1.3.0, environs==9.3.5, fastapi==0.70.0, loguru==0.5.3, ma... (348 characters truncated)
14:54:26.79 [INFO] Completed: Building requirements_venv.pex
14:54:31.28 [ERROR] Completed: Typecheck using MyPy - MyPy failed (exit code 2).
pants-plugins is not a valid Python package name



š„‚ MyPy failed.
w
Is this your own private repo? Or the PantsBuild one?
(in summary, no, you shouldn't need to if it's your own repo)
r
this is my own repo where I have a folder called
pants-plugins
where I store custom plugins. This I borrowed it from pants repo
w
Okay, so it -should- work, but it depends on configuration and source roots, and the like. Conveniently, I wrote a blog post about this kinda stuff last night. https://sureshjoshi.com/development/pants-plugin-code-quality and here is the associated repo (https://github.com/sureshjoshi/pants-example-plugin). You can run
./pants check ::
on it to verify, and compare the configurations maybe? If your repo is open source, I can look at it too
ā¤ļø 2
r
Mypy is complaining about invalid python package name. I suppose I should just change
pants-plugins
to mypy conforming python package name
w
I use
pants-plugins
as a folder name, without any issue
It should be a source root, though, rather than a package
šŸ‘ 1
r
It's part of my source root
Copy code
[source]
root_patterns = [
  "/pants-plugins"
]
w
Is it on github? It's hard to debug without seeing much
r
no, it's a private repo. I will try to see if I am missing something. Thanks for the help!
šŸ‘ 1
p
Do you have a dunderinit in there you don't need?
āž• 3
r
what is a dunderinit? <just googled> Yes I do have one. Let me try removing that. That fixes the issue.
šŸ™Œ 3
h
oh python šŸ™‚ thanks @prehistoric-afternoon-67621 and @wide-midnight-78598!
w
Oh, a top-level one I guess? Yeah,
mypy
be greedy