-
Notifications
You must be signed in to change notification settings - Fork 137
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
tasks.json watcher launched by debugger never flags as a ready background task #676
Comments
Because that's not at all what I'm trying to do. I'm trying to run an arbitrary script, not an app, and your example fails before doing anything: Without enumerating each and every potential script in The second solution is unideal as it puts a top-level dependency requirement on debugpy, instead of abstracting it all to poetry. Still fails anyway. Giving
and can't set it with a prelaunch task because it's run in a different terminal instance {
"label": "poetryPyPath",
"type":"shell",
"command": "set",
"args": [
"PYTHONPATH= $env:userprofile\\.poetry\\bin\\poetry"
],
} By running it with a prelaunch task:
I know that the base case works, because I can run, say,
in PowerShell then run a "dumb" debugger of {
"name": "Poetry",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5710
}
} and it "Just Works". Fundamentally all I'm trying to do is automate that script part for the rest of the team. |
@tigerhawkvok Thanks for the details. I will transfer this to the debugger repo. There might be two separate issues here. Both in the debugger.
|
I'll investigate. |
As a note, regarding the |
As a note, I couldn't get the solution to work properly (because This may be due to some misunderstanding on my part, but from what I can tell, the process is correctly stopped in the I'm not very knowledgeable on how the prelaunch with a task defined in the Still, I was thinking that what's being done is essentially the same thing as a launch with the following contents:
Which should automatically attach to the subprocess which poetry launches and seems to do everything requested for me (without needing a prelaunch task) -- @tigerhawkvok could that be a better solution for your use case? |
Poetry by design doesn't install "into" a python distro: https://python-poetry.org/docs/#installation
which is why, I'm pretty sure, yesterday's suggestion failed. I'm skeptical about changing something into an unsupported configuration to monkey-patch something else. I did interpret the base issue being the attacher in vscode like you do, @fabioz , but at microsoft/vscode#129121 they closed this issue and punted me over here. Just in case I updated the debugpy version but it didn't resolve the issue. |
Actually, that's all smoke and mirrors... If you take a better look at it, you'll see that it'll just use the Still, I agree there's one difference, it's forcing to use the poetry at
-- although I must say I personally prefer to just choose a python base environment to have poetry installed there and run things with |
Actually, I saw that it does one thing different in how it vendors some dependencies so that it can be executed in any env, so, the solution above isn't 100% correct, a better approach to use the global poetry is just launching i.e.:
|
@fabioz that's a thing of beauty that "just works". Closing issue. |
Environment data
python.languageServer
setting: pylanceWas initially filed under microsoft/vscode#129121
Version: 1.58.2 (user setup)
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:10:15.214Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19043
Steps to Reproduce:
I'm trying to run my debug environment as a Poetry session, so I can properly debug encapsulated.
So, my
launch.json
is straightforward:and I adapted my
tasks.json
to try to launchdebugpy
in Poetry first (this works if I manually run the command in the terminal then run thelaunch.json
without thepreLaunchTask
)When I start debugging, the task is properly launched, and debugpy gets all the way to the message I am waiting for that I want the preluanch task to be marked as "ready":
I could have sworn I had this working last week but as of 1.58.2 after a restart this morning it doesn't progress past
wait_for_client()
display, so the debugger never attaches. I'm also a little suspicious that${relativeFile}
includes a full path in my output but that probably doesn't matter.Logs
No relevant logs, only pylint scoring
The text was updated successfully, but these errors were encountered: