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

Windows + VSCode + vscode-proto3: unable to find protoc-gen-mypy unless .exe extension is specified in .bat script #215

Closed
Gliptal opened this issue Mar 26, 2021 · 2 comments · Fixed by #262

Comments

@Gliptal
Copy link

Gliptal commented Mar 26, 2021

When using vscode-proto3 on VSCode:

"protoc": {
            "path": "C:\\Portable\\Protobuf\\protoc.exe",
            "compile_on_save": true,
            "options": [
                "--plugin=protoc-gen-mypy=${workspaceRoot}/.venv/Scripts/protoc_gen_mypy.bat",
                "--proto_path=${workspaceRoot}/src/module/network/proto",
                "--python_out=${workspaceRoot}/src/module/network/proto",
                "--mypy_out=${workspaceRoot}/src/module/network/proto"
            ]
        }

protoc throws an error aboiut being unable to find protoc-gen-mypy:

Code_q7ZJZJRXrb

This can be easily solved by adding .exe to the .bat script:

@echo off
%~dp0\python -u %0\..\protoc-gen-mypy.exe

Am I missing something in the setup or protoc's commandline parameters?

@nipunn1313
Copy link
Owner

haven't tested explicitly on windows in quite a while - it used to reference protoc-gen-mypy as a sibling - it is possible that 034f0f0 may have changed the way this works.

It would be awesome if we were able to add internal tests to really verify things work on windows.
If you can confirm that it installs to protoc-gen-mypy.exe rather than protoc-gen-mypy on windows, then happy to accept such a diff!

Am curious whether you could directly pass

--plugin=protoc-gen-mypy=${workspaceRoot}/.venv/Scripts/protoc_gen_mypy.exe

If that's the case, then perhaps we can drop the .bat file entirely.

@nipunn1313
Copy link
Owner

We used to have the bat file prior to #102 - since the original file was not executable. The console entrypoints may obviate the need for the batch file.

Thanks for the report!

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

Successfully merging a pull request may close this issue.

2 participants