Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to run multiple daemons for single workspace (e.g. for monorepos) #82

Open
luisacabs-out opened this issue Oct 27, 2023 · 5 comments

Comments

@luisacabs-out
Copy link

Hi there.

I have a multi-root project and usually I work in the root of my project and select the venv for the service I'm working on. But without updating the target everytime mypy will run for the entire project, which I don't want.

Is there an option to set the target settings dynamically? In theory I could retrieve the target from the python interpreter I'm using, however I don't think I can add that to the settings as it is.

Is there a chance this could be implemented?

@matangover
Copy link
Owner

First of all, interesting use case, second of all, how did you get 5 upvotes so fast 😅

Why does it matter to you that mypy runs for the entire workspace? There is one mypy daemon for each workspace folder. Mypy will only recheck changed files and their dependencies

@luisacabs-out
Copy link
Author

First of all, I am sorry for the very late reply.

Regarding the use case:

I have a project with multiple packages and services in the same repo. Every service has dependencies to these packages, but at the moment we are using local dependencies instead of releasing the package.
Because of this, when I open the service in vscode (not at the root of the repo, but the root of the service), I lose intellisense regarding those packages. Therefore I usually work at the root of my repo in every service/package.

With this setup, I lose the mypy configuration I have for each service/package. I'm using other linters like flake8 for which I use the same configuration for all services, but for mypy I have different configurations for each service.
So ideally I would like to be able to define a configuration file in vscode settings, that's based on the python interpreter I am using atm 😄

@matangover
Copy link
Owner

matangover commented Feb 6, 2024

Thanks for explaining. Alright, I understand your use case. I think the core missing feature for you here is to run multiple mypy daemons for a single workspace (or workspace folder).

You would specify the new setting mypy.rootPaths: ["src/service1", "src/service2"] etc.
Then my extension would run a separate mypy dameon for each root path. Each daemon would have its own configuration file and targets. This could be useful for people that are working with monorepos.

@matangover
Copy link
Owner

Please advise if this would solve your use case

@luisacabs-out
Copy link
Author

Yes, that would solve it 🙏

@matangover matangover changed the title Dynamic targets Ability to run multiple daemons for single workspace (e.g. for monorepos) Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants