-
Notifications
You must be signed in to change notification settings - Fork 29
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
Unable to set config to ignore errors related to a specific module #329
Comments
@taranlu-houzz Where is your A thing you can try that was recently added is support for |
Hi @karthiknadig, this is what the structure of the of the project is:
The Thank you for the tip about |
@taranlu-houzz The logs should show which directory was used by Look at see here for more details: https://github.com/microsoft/vscode-mypy?tab=readme-ov-file#settings |
So I belive this is an issue with mypy. Looks like if you pass a specific file to mypy (as oppsosed to passing a directory like .), mypy will ignore the exclude list. Like for example if i have tests/ in the exclude list, and run mypy with |
@sarpuser you can try setting |
Diagnostic Data
mayapy
)Behaviour
Expected Behavior
The
mypy
extension should fully respect the config in thepyproject.toml
and I should see identical results to what I get when running directly on the cli.Actual Behavior
I am trying to get
mypy
in VSCode to ignoremaya.*
modules. When I runmypy
directly via the command line using mypyproject.toml
config, it does not raise errors as expected, but when I refreshmypy
in VSCode, no matter what I do, it always hightlights error related to themaya.cmds
module that I am using in my code.More info on the
maya.*
modules: These are made available via Autodesk Maya's utilitymayapy
, which sets things up to use themaya.*
packages that are internal to your Maya installation (previously, this was a shell script, but it appears to be a binary these days). I had previously set VSCode to usemayapy
as the interpreter in order to get better auto-completion, but it turned out that is actually what caused a lot of new errors to show up due to how themaya.cmds
module is written (it seems the functions only have the "short names" for their params as far as VSCode/mypy are concerned, but the long versions still work and are what I prefer to usee.g. maya.cmds.ls(sl=True) vs maya.cmds.ls(selection=True)
).Oddly, when I change the interpreter that VSCode uses to a different empty venv, it still raises errors that it could not possibly know about unless it followed the imports somehow, but that should not even be possible in an empty venv that does not have any connection to Maya. I'm also curious: is it possible to unset the Python interpreter? That setting doesn't seem to be store in the project's
.vscode/settings
.Reproduction Steps:
This the
mypy
config from mypyproject.toml
:I have tried various other possibilities for the module name/pattern, including
maya.cmds
,cmds
(since I import as that), etc. Unfortunately, nothing works, and it still complains about an error that it could not possibly know about based on the current interpreter selected.Extra Details
pyproject.toml
The text was updated successfully, but these errors were encountered: