-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update Pyramid debug template to use python -m pyramid.scripts.pserve
#2427
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
Comments
So our current solution works for me, but your idea does seem reasonable, @JDeuce . I have asked on Twitter whether we can rely on this since none of the Pyramid docs seem to suggest this is a supported way to start up |
Ok, I investigated a little more on my system. This is the error I was getting. I had the pythonPath set to the same virtualenv "${workspaceFolder/env}" in both in launch.json and expected it to work. I played with it a bit more and ended up getting the error to go away when I set
in my workspace settings. So I think it has to do with the setup.py console script wrapper (pserve.exe) starting a new interpreter that uses the other path or something, which is an interesting distinction from the other module style launch option. |
@brettcannon I'm not sure whether these two Pyramid docs cover what you did not find. If not, please let me know how to improve them. I'd be happy to update them. Thank you! |
This is true but the |
@stevepiercy Those pages didn't cover what I was after as there was no direct mention that @mmerickel thanks for the clarification! Since Pyramid 1.5 was released in April 2014, I think that's long enough for us to be able to rely on it. I think the suggestion by @JDeuce will be a win long-term for us as it means less TypeScript code to maintain like we have now and there's no special flag to pass into ptvsd like there is for Django and Flask. The trick, though, is deprecating the |
@brettcannon Gotcha. It's here: https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/commandline.html#using-custom-arguments-to-python-when-running-p-scripts Do you have a suggestion to improve the wording or elevate it to make it more discoverable for what you were searching? I can update, no problem. |
Best I can think is to explicitly link to that mention from the |
@brettcannon I've got an open PR with some improvements. Please let me know if this hits the mark. Thank you! |
python -m pyramid.scripts.pserve
Hi there has been an issue reported before where the "Pyramid" debug option tries to find the wrong pserve on some platforms.
#530
The fix was submitted here:
f22b451
And it added this block of code to fix it, which uses pserve.exe on Windows and pserve on everything else:
https://github.com/jpfarias/vscode-python/blob/master/src/client/debugger/Main.ts#L217-L224
I don't believe this fix was sufficient as today using VSCode 1.26.1 and vscode-python 2018.7.1 I was getting launch error
Unable to locate 'pserve.py' required for debugging Pyramid application
Solution for me was to just not try to use the "program" launch style, but instead use the "module" launch style like the "flask" example. I think you guys should consider changing the default to this as it is simpler to understand ..... and deprecate the custom DebugOption as it is not required nor simpler:
The text was updated successfully, but these errors were encountered: