theia-ide / theia-apps

Theia applications examples - docker images, desktop apps, packagings
Apache License 2.0
1.04k stars 344 forks source link

[python] Recent versions of ms.python have dependency to ms-toolsai.jupyter, that's not available on open-vsx.org #441

Open ande8331 opened 3 years ago

ande8331 commented 3 years ago

Hi, I'm unable to use the debugger within the Python Docker Container. The script runs file when invoked from the shell, but quickly exits with no error messages or exceptions when run through the debugger, just an error message in the Debug console that seems unrelated to the script being debugged. Any ideas on how to work around this?

Steps to Reproduce:

  1. $ docker pull theiaide/theia-python:latest latest: Pulling from theiaide/theia-python ... Digest: sha256:e76ca104c62be20fa54746a109a88430f034a86691c1e8dc5f711a5eda241198 Status: Downloaded newer image for theiaide/theia-python:latest docker.io/theiaide/theia-python:latest
  2. $ docker run -it --init --rm -p 3000:3000 -v "$(pwd):/home/project" theiaide/theia-python:latest
  3. Create a helloWorld.py file, first line: print("Hello World")
  4. Set breakpoint at first line in created file.
  5. Click Green Run for debugger (may need to create a "Python: Current File" debug profile here)
  6. A thread flashes by in the debug window.

Result: Break point is not stopped at, find the error message below in the Debug Console.

Error Message: (Found in Debug Console)

Debugger Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.
Debugger Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.
Error
Error: The number of constructor arguments in the derived class s must be >= than the number of constructor arguments of its base class.
    at /home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:16:27311
    at Array.forEach ()
    at e (/home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:16:26875)
    at Object.t.plan (/home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:16:27386)
    at /home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:16:24044
    at e._get (/home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:16:23953)
    at e.get (/home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:16:22664)
    at s.get (/home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:68:141080)
    at new _ (/home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:1:269045)
    at /home/theia/plugins/vscode-python/extension/out/client/debugger/debugAdapter/main.js:1:272287
vince-fugnitto commented 3 years ago

@ande8331 the issue seems related to a similar problem (https://github.com/cdr/code-server/issues/1821) experienced by the ms-python extension. If you'd like to troubleshoot, and/or provide a fix you can attempt to update the python extension to a newer version and confirm that the issue is resolved:

https://github.com/theia-ide/theia-apps/blob/1df3ba2ae48ed27d58d656a9c67ae5d3bed6deca/theia-python-docker/next.package.json#L99

https://github.com/theia-ide/theia-apps/blob/1df3ba2ae48ed27d58d656a9c67ae5d3bed6deca/theia-python-docker/latest.package.json#L99

ande8331 commented 3 years ago

Thanks for the quick response @vince-fugnitto. I tried out a couple of ms-python versions:

Looking into why the newest didn't work, it appears that ms-toolsai.jupyter is now a required dependency for ms-python; but its not available in openvsx, nor can I find a path that results in downloading a file with the vsix extension.

Any way around this?

marcdumais-work commented 3 years ago

Hi @ande8331 ,

You're right - ms-toolsai.jupyter I think was split from the Python extension recently, and is now a dependency. Momentarily it's not on open-vsx, but even if it were, I do not think we currently support the vscode extensions' API to run this bleeding-edge version.

You could try an older version, like this one: https://open-vsx.org/api/ms-python/python/2019.11.1/file/ms-python.python-2019.11.1.vsix, or if you download it from the Marketplace, the exact older version reported to work with code-server: 2020.5.86806

stale[bot] commented 3 years ago

This contribution has been automatically marked as stale due to inactivity, and it will be closed if no further activity occurs. Thank you for contributing to Theia!

marcdumais-work commented 3 years ago

One way forward would be to have the dependent extension, ms-toolsai.jupyter, available on open-vsx.org. The extension's source code (1) is licensed under MIT, but the extension itself is under a proprietary Microsoft license (2).

This may mean that the extension, even when built from MIT sources, contains proprietary content, for which (2) applies, preventing any non-Visual-Studio product from legally using that extension(3). For example, such content could be fetched when the extension is first activated.

1 - https://github.com/microsoft/vscode-jupyter 2 - https://github.com/microsoft/vscode-jupyter/blob/main/extension_license.txt 3 - see section 1a from (2): "You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services"

If the above is correct, the extension will most likely not be acceptable, to be hosted on open-vsx.org :(

rhildred commented 3 years ago

@ande8331 your fix worked for me. I used https://github.com/microsoft/vscode-python/releases/download/2020.10.332292344/ms-python-release.vsix and am back debugging.