-
-
Notifications
You must be signed in to change notification settings - Fork 27
Make it work on Windows #14
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
Conversation
@@ -180,12 +189,10 @@ def typecheck_in_same_process(self, execution_path: Path, mypy_cmd_options: List | |||
# add current directory to path | |||
sys.path.insert(0, str(execution_path)) | |||
|
|||
with capturer.CaptureOutput(merged=False) as captured_std_streams: | |||
with capture_std_streams() as (stdout, stderr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, I believe I noticed typecheck_in_same_process
isn't covered by the tests
pytest_mypy/tests/test-extension.yml
Outdated
@@ -3,5 +3,5 @@ | |||
# if hook works, main should contain 'reveal_type(1)' | |||
reveal_type: 1 | |||
out: | | |||
main:1: note: Revealed type is 'builtins.int' | |||
main:1: note: Revealed type is 'Literal[1]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mentioned it in the commit, but I needed to change this so that the tests would pass on the latest mypy version (0.750
). Was failing on Travis as well: https://travis-ci.com/typeddjango/pytest-mypy-plugins/jobs/265800510
@@ -163,6 +167,9 @@ def typecheck_in_new_subprocess(self, execution_path: Path, mypy_cmd_options: Li | |||
|
|||
# add current directory to path | |||
self.environment_variables['PYTHONPATH'] = str(execution_path) | |||
# Windows requires this to be set, otherwise the interpreter crashes | |||
if 'SYSTEMROOT' in os.environ: | |||
self.environment_variables['SYSTEMROOT'] = os.environ['SYSTEMROOT'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, just found out this is documented in subprocess.Popen
@mkurnikov Welcome! Thanks for your work on this. |
* make it work on Windows. ditch capturer. * fix test for mypy==0.750
Remove
capturer
dependency: usecontextlib.redirect_*
instead.Also fixed some other minor issues
See #13