https://pantsbuild.org/ logo
r

refined-addition-53644

04/05/2022, 12:58 PM
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

wide-midnight-78598

04/05/2022, 1:57 PM
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

refined-addition-53644

04/05/2022, 2:12 PM
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

wide-midnight-78598

04/05/2022, 2:13 PM
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

refined-addition-53644

04/05/2022, 2:14 PM
Mypy is complaining about invalid python package name. I suppose I should just change
pants-plugins
to mypy conforming python package name
w

wide-midnight-78598

04/05/2022, 2:15 PM
I use
pants-plugins
as a folder name, without any issue
It should be a source root, though, rather than a package
šŸ‘ 1
r

refined-addition-53644

04/05/2022, 2:16 PM
It's part of my source root
Copy code
[source]
root_patterns = [
  "/pants-plugins"
]
w

wide-midnight-78598

04/05/2022, 2:17 PM
Is it on github? It's hard to debug without seeing much
r

refined-addition-53644

04/05/2022, 2:18 PM
no, it's a private repo. I will try to see if I am missing something. Thanks for the help!
šŸ‘ 1
p

prehistoric-afternoon-67621

04/05/2022, 2:55 PM
Do you have a dunderinit in there you don't need?
āž• 3
r

refined-addition-53644

04/05/2022, 3:00 PM
what is a dunderinit? <just googled> Yes I do have one. Let me try removing that. That fixes the issue.
šŸ™Œ 3
h

hundreds-father-404

04/05/2022, 3:49 PM
oh python šŸ™‚ thanks @prehistoric-afternoon-67621 and @wide-midnight-78598!
w

wide-midnight-78598

04/05/2022, 4:58 PM
Oh, a top-level one I guess? Yeah,
mypy
be greedy
5 Views