4 ms·
Only reason I use virtual environments instead of just building everything inside Docker containers is the debug experience, which is not good enough inside a D
by molly0 4y ago
Only reason I use virtual environments instead of just building everything inside Docker containers is the debug experience, which is not good enough inside a Docker container.
- TekMol 4y agoHow is debugging inside a container different than on the host os?
- molly0 4y agoWell to use something like "debugpy" It's the port mapping that just dosn't work straight out of the box, but needs custom settings inside my editor (and often times additional code inside the startup script) to get it working between the container and my local machine.
- TekMol 4y agoIt sounds like you want to do the debugging outside of the container? I just do it inside the container with pudb.
- Zizizizz 4y agoHow does your LSP pick up everything like imports if they only live in a docker container?
- TekMol 4y agoLSP?
- Zizizizz 4y agohttps://code.visualstudio.com/api/language-extensions/language-server-extension-guide https://code.visualstudio.com/api/language-extensions/langua... Basically just your auto-completion, linting, quick-actions, etc...
- TekMol 4y agoWhy does it care if the application runs in a container? When you run a project in a container, you mount the projects directory into the container. That is nothing my editor cares about. It does not even know it. It works on the files locally on the host os and that's it. The the files are executed somewhere inside a container is none of the editors business.
- contravariant 4y agoIt doesn't technically care, but if your container is reporting that it has hit a breakpoint in file /mnt/some_module/script.py, then your LSP / debugger / editor is not going to know what it is talking about without some more info.
- TekMol 4y agoI do debugging inside the container with pudb.
- 323 4y agoYou run the LSP also inside the container and connect to it remotely. https://code.visualstudio.com/docs/devcontainers/containers https://code.visualstudio.com/docs/devcontainers/containers
- Zizizizz 4y agoOkay that makes sense, I don't really see how it's simpler but I completely see the use case. I was unclear on what he/she meant by the editor "just working" without having some config or plugin to point to the installed packages
- cryvate1284 4y agoIn my view, you'd normally still want to use a virtual environment or ignore the system site packages. The system will have a bunch a bunch of (site) packages already installed, and hence you lose control.