matangover/mypy-vscode

Python monorepo support

Closed this issue · 3 comments

Its very convenient in many cases to have monorepo with all your python packages and projects

But this plugin currently supports only one project in workspace and this project needs to be specified in vscode workspace settings (so every contributor should configure it manually)

Also folder structure could be different from python_package_styles, e.g. have kebab-style naming

It's ok for projects described using pyproject.toml and for poetry — name your folder as you like and specify desired package name (e.g. folder is my-awesome-module, and module is exposed as my_awesome_module or just awesome_module)

With pyproject.toml and poetry you can have separated shared libs and projects.
Then you specify path to desired module in dependencies section of pyproject.toml

May be this works event with other package-systems, pyproject.toml is PEP standart, but I have no such experience

So it would be awesome if this plugin could:

  • Support multiple projects in one workspace
  • Treat as project a folder with pyproject.toml and respect its packages option

Article about python monorepos https://medium.com/opendoor-labs/our-python-monorepo-d34028f2b6fa
Simple example on github https://github.com/ya-mori/python-monorepo/tree/master/sample_1

I can write manual checking, e.g. on precommit, but it's not as convenient as having IDE knowing what I am doing and checking code as I write it

Sorry for bad english, I'm from Yakutia

By 'multiple projects', do you mean to run multiple dmypy instances for a single workspace folder?

I think that's what would be required due to mypy having very poor multi-project support python/mypy#10428

Sorry for late reply, but I think your use case is solved by specifying multiple targets using the mypy.targets config. Closing this for now, please let me know if this doesn't work for you.