leinardi / mypy-pycharm

A plugin providing both real-time and on-demand scanning of Python files with Mypy from within PyCharm/IDEA.
Apache License 2.0
188 stars 30 forks source link

Allow remote interpreter #111

Closed jack-hegman closed 11 months ago

jack-hegman commented 11 months ago

First time contributor checklist

Contributor checklist


Description

Respect the 'Path to MyPy Executable' field. Previously with a remote interpreter setup, a user could not specify a path to a local interpreter to run mypy without getting an error saying: "No project interpreter configured". With these changes, the path to MyPy executable is checked and used if supplied, instead of checking for a project interpreter first. This should fix the issue people are having with remote interpreters as well as allow people developing on WSL to configure a local windows interpreter to run mypy.

Type of Changes

Type
:bug: Bug fix

Related Issue

Closes #63 Closes #110

leinardi commented 11 months ago

Hi @jack-hegman, thank you for the PR. On which OS was it tested? It seems to do something similar to #99 and there there were some OS specific issues...

NKPmedia commented 11 months ago

I tested it on Windows with a conda env in wsl and a venv on Windows. Mypy is installed in the venv and the wsl env is activated. I can start the mypy scan without any issue.

leinardi commented 11 months ago

Nice :+1:

Is anyone able to test on Mac or Linux?

jack-hegman commented 11 months ago

@leinardi I tested with Mac on a project using a remote interpreter

leinardi commented 11 months ago

@jack-hegman Thanks! Tomorrow I'll check for regressions on Linux and, if everything is fine, I'll merge it :+1:

Johnhersh commented 8 months ago

Is there something I need to do in order to enable this? I can't get Mypy to work with a remote interpreter: https://github.com/leinardi/mypy-pycharm/issues/63#issuecomment-1810115542