Skip to content
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

[Feature Request] Setup the environment and poetry to work with Docker #1201

Open
Mithrandir2k18 opened this issue May 23, 2022 · 4 comments

Comments

@Mithrandir2k18
Copy link

Mithrandir2k18 commented May 23, 2022

I really like this template and have been using it for a while, but it seems to have one critical blindspot: Supporting and switching between multiple python versions. Sure it's possible to kind of slap on pyenv and work with that, but I personally have found these external python-version management systems(like pyenv and anaconda) kind of cludgy, especially when it comes to cleaning up after moving to a different project.

Docker on the other hand makes that super-simple. Even if you don't cleanly specify to delete all intermediate containers, one can always do docker system prune and all cleanup should be done. I don't think I have to list all benefits of using Docker during development here.

I have however struggled to setup docker in combination with poetry, let alone adding debugging in VSCode. Poetry also doesn't seem to have documentation about it.

Would it be possible to add Docker support (as an option)?

@Coinhexa
Copy link

Before you add a Dockerfile you might wanna read this https://luis-sena.medium.com/creating-the-perfect-python-dockerfile-51bdec41f1c8

@Mithrandir2k18
Copy link
Author

Mithrandir2k18 commented Sep 30, 2022

@Coinhexa I'd much rather be able to develop, run and test my code in the dockerfile(s) that I plan to ship or push for automated tests, not have another extra "one size fits all" image to carry around and maintain. My pre-poetry workflow, was (similar to) just having a package-list.txt to install system packages and a normal requirements.txt for python in my project and build a fresh docker image with those. For development I just use the VSCode docker extension.

In any case, docker seems like a weird exclusion here.

@ianepreston
Copy link

Not sure if this should be attached to this issue or have a separate one created, please let me know.

I don't mind using pyenv for multiple python versions, but I have found it challenging to ensure the system dependencies are all in place to support it, either for myself on a new machine or for another person I'm trying to help onboard.

To address this I've been working on building a dev container spec that will have everything in place to start using this template. You'd still be using pyenv within the project, but I think it would address the above concern about nicely cleaning up your environment, as well as my issue of reliably creating the environment to begin with.

If there's broader interest in this approach I'm happy to contribute to getting the dev container spec added to this template.

@Mithrandir2k18
Copy link
Author

See poetry+docker efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants