tango-controls / pytango

This project was moved to gitlab.com
http://pytango.rtfd.io
54 stars 44 forks source link

VScode remote development container support #377

Closed DrewDevereux closed 4 years ago

DrewDevereux commented 4 years ago

This pull request adds VScode remote container support.

There's not much to it: just a basic devcontainer.json configuration file, and a couple of paragraphs of documentation.

I also markdownlinted the README.md while I was editing it, I hope that's okay.

It would have been nice if python setup.py build could have been added to the container config as a postCreateCommand, but unfortunately that has proven problematic (when run as a postCreateCommand, it gets stuck in the build-ext stage at subprocess.Popen.)

ajoubertza commented 4 years ago

Thanks for the VScode addition, @DrewDevereux. Improving the docs is always welcome.

It would have been nice if python setup.py build could have been added to the container config as a postCreateCommand, but unfortunately that has proven problematic (when run as a postCreateCommand, it gets stuck in the build-ext stage at subprocess.Popen.)

Yes, it would be nice if the extension was compiled in the container the first time. The compilation does take around 10 minutes, so was it really stuck, or just churning away in the background?

If we're just changing the Python files, then this would work well. However, if any of the extension C++ code is changed as part of our development, we need to remember to rebuild the extension. I typically have the pytango source on my host, but mounted inside the container. Then the result of a python setup.py build persists when the container is relaunched. At least that's what is happening with PyCharm. I imagine it would be similar with VScode.

DrewDevereux commented 4 years ago

I shouldn't have said it "gets stuck": it fails when it reaches that Popen. Yes, that's how VScode works: the source is on the host, and VScode mounts it, writable, in the container.