-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: custom roots #100
base: master
Are you sure you want to change the base?
feat: custom roots #100
Conversation
Hi! Good start for the implementation. Do you use a different venv for each of your 'roots'? Otherwise, maybe just using |
we do, though we have been working on ways to build a top-level venv that contains all the dependencies of every project in the repo. i'm not certain this would fully solve the issue though as mypy still detects the "duplicated" test modules:
we can exclude tests entirely, but it'd be nice to have them type-checked too. do you know if this particular issue is solvable with |
Try giving the 'src' directory as your target. (Instead of giving
Technically mypy can process any number of targets (files/folders) in a single run, and they don't need to be from the same package. But yeah you may have issues with module name collisions like you said... |
In any case I'm not against this PR - don't get me wrong. If you want to complete it you need to make sure all the daemons are stopped properly, as well as handling configuration changes like you said. And thinking how to configure the venv (or other settings?) of each such 'root' separately? (maybe just with the mypy config file in that case?) |
yeah i understand - if there is another solution that doesn't need the overhead of multiple mypy processes i'd certainly prefer it! i'll try your suggestion with the targets again tomorrow and see if i can get it working that way. thanks :) |
i'm working with a monorepo, and i can't use a multi-root workspace as it causes vscode to slow to a crawl for some reason (can be 30+ seconds delay on completions, linters, et cetera.) i suspect it may be due to the remote devcontainer workspaces we use. that issue aside, i personally find multi-root workspaces to be a little unwieldy and difficult to manage, getting worse as more roots are added.
i saw #82 and thought that might work for my needs, so i had a go at a prototype implementation. right now it only exists as part of the "recheck" command to make it easier to test, and i wasn't too confident about how to properly integrate it with the extension to start automatically and properly handle changes to the workspace, settings, et cetera.
by way of a demo, i set up a structure to mimic the monorepo i use with some intentional type errors in each of the packages:
i configure the extension like so:
starting the extension in this workspace normally raises the following issue:
i then run
Mypy: Recheck Workspace
to trigger the code i added, and i see the following:at its most basic level, this is working the way i want it to.
if you like the way this is going, i would really appreciate any assistance you can offer towards getting this worked into a proper functioning feature! i am very inexperienced in both typescript and vscode extension development, so i could use all the help i can get.
p.s. sorry for the excess changes, vscode was very set on reformatting everything constantly. if it's annoying i'll edit the commits to remove any non-functional changes.
thanks!