Poetry debugging with PyCharm not possible? #9817
Replies: 10 comments
-
Update! https://youtrack.jetbrains.com/issue/PY-52864 Cheers, |
Beta Was this translation helpful? Give feedback.
-
Workaround found! Unchecking Solves the the problem. This also disables the debugging of subprocesses, so this is not a general solution but only a workaround. A clean solution would be for Poetry to check if it is run from PyCharm, debugger. Poetry already checks for some execution environments Anaconda, Mingw, etc, why not also checking for PyCharm debugging? Cheers, Volker |
Beta Was this translation helpful? Give feedback.
-
Hello @volkerjaenisch, thanks a lot for looking into this and finding a workaround 👍 I realized this problem as well but never tried to have a closer look into it.
Do you have any literature about this? I've no idea where to start :( fin swimmer |
Beta Was this translation helpful? Give feedback.
-
Dear @finswimmer
You are welcome!
I would like to have either :-) Best chances are to hop on my issue ticket at PyCharm https://youtrack.jetbrains.com/issue/PY-52864 and ask for advice there. The more people will join the discussion there the more gravity the issue gets. Cheers, |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, you can try diving into |
Beta Was this translation helpful? Give feedback.
-
We are trying to create a pull request for another unrelated Issue and would appreatiate the PyCharm debugger too. |
Beta Was this translation helpful? Give feedback.
-
Hello @volkerjaenisch ! Thanks for your investigation around this issue. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Dear @CarlosDLMC |
Beta Was this translation helpful? Give feedback.
-
Also, the issue is mostly because of Poetry aggressively using subprocesses to introspect the states of remote Python environments (we run |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Issue
Hi!
I am working on a Poetry enhancement to install Anaconda packages with Poetry. The package resolution already works fine. I just transformed the Anaconda packages into dummy Python Wheels reflecting the conda package dependencies. These dummy wheels I deliver via a private PyPIserver. And Poetry can work with them.
As you can see the dummy Wheels as well as the resolution of the deps works quite well.
But now I have to build a CondaInstaller(BaseInstaller) that does the actual symlinking of the conda-packages into the Poetry-venv. Or if this is not so easy I could utilize Conda to do the same thing. This should be only a couple of lines.
But to enhance the Poetry Code I must be able to debug it from within PyCharm.
Running poetry from PyCharm works without problems. I configured the run-config to utilize ~/.local/bin/poetry with cmd line parameters "add numpy". As Interpreter I can choose the venv poetry is installed in or the system python. The working directory is set to the target venv "test_poetry" where the numpy package should be added. Works like charm.
But when I activate the debugging I get the following stacktrace. This is independet of interpreter settings etc.:
This behavior is quite easily to reproduce. Just try to debug a typical installation of Poetry with PyCharm.
This looks to me as if Poetry switches the interpreter and this messes up with the pydevd debug framework. I can actually debug poetry for a while, but in
the exception is raised.
Any help appreciated
Volker
Beta Was this translation helpful? Give feedback.
All reactions