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

Does this support calling bash script which then calls python script? #324

Closed
dwbelliston opened this issue Jul 2, 2020 · 2 comments
Closed
Labels
question Further information is requested

Comments

@dwbelliston
Copy link

Im trying to do something like

command: -c "pip3 install debugpy -t /tmp && python3 /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -c </glue/bin/gluesparksubmit /opt/src/main.py>"

I see in file

def run_code():
- there is a 'run_code' method that might be the general idea of what i am trying to achieve but not sure this is intended use.

@int19h
Copy link
Contributor

int19h commented Jul 2, 2020

We didn't doc "code" properly yet, but microsoft/vscode-python#12500 mostly explains it. It's the equivalent of python -c ....

So it doesn't apply to your scenario. In general, we do need to control the command line passed to Python, so intermediate scripts like that aren't supported - unless they're themselves written in Python, and the code that you want to debug runs in that same process, or a child process that is started directly by Python code (i.e. no intermediate bash scripts there, either). I'm not familiar with gluesparksubmit, so I don't know if doing an equivalent in Python is possible.

I think you can do pip install via a pre-launch task (look for preLaunchTask at https://code.visualstudio.com/docs/editor/debugging).

@int19h
Copy link
Contributor

int19h commented Jul 2, 2020

Oh, and keep in mind that there's also the API to spin up the debug server - this is more ugly, since you need to explicitly call it from the code you're trying to debug. But the advantage is that it doesn't matter how that process is started - so long as you can invoke listen() before the code you want to debug is executed (in the same process), it should work.

https://github.com/microsoft/debugpy/wiki/API-Reference

@int19h int19h added the question Further information is requested label Jul 2, 2020
@int19h int19h closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants