flux-core
flux-core copied to clipboard
Add Python black formatter into docker images
Black formatter is required for our python code style. We might as well install python black formatter into docker. It is possible this has already been added since I'm using a slightly old docker image though.
The black formatter is pulled in by pip before docker-run-checks in travis, and is installed with --upgrade so that the latest version is always run. Installing into the docker image isn't a bad idea, but I'm afraid the version in the docker image will quickly become out of sync with the version used to do the actual testing...
Not sure if this would be helpful, but we could create a new Dockerfile/image for development that includes things like gdb and black. It could be another "flavor" alongside bionic and centos7, or it could be built on top of those flavors and not pushed to docker hub (i.e., devs would just build it locally whenever they need it). I think (could be way wrong) that either of these methods would keep the tools up-to-date w.r.t. the code contained within the same images.
I like that idea. I also certainly want one with totalview dependecies.
It could be another "flavor" alongside bionic and centos7
Just to save space, it should probably be built on top of one of the images that already contains other dependencies for flux (then you only have to save one extra fs layer with devel environment).
This could be treated like the travis image we have now.
This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 14 days. Thank you for your contributions.
Just to save space, it should probably be built on top of one of the images that already contains other dependencies for flux (then you only have to save one extra fs layer with devel environment).
Sounds good. From this thread, looks like the pylint, black, and gdb packages could be added. If we are adding gdb I wonder if it is worth adding the debug symbol packages for our various dependencies.
Just wondering - what is the goal to install black into the image? Do people use it for development? Usually a black --check is more suitable during CI (that then builds the image) over providing it in the container. What is the use case here?
I'm guessing that development tools like black pylint gdb strace etc would be valuable for people using the container for development (e.g. on a mac)
We have black in our developer container environment: https://github.com/flux-framework/flux-core/blob/b0c565f9a08820cf0d1d3995cfd6488c04d21b64/scripts/requirements-dev.txt#L5 that is documented here: https://github.com/flux-framework/flux-core/blob/b0c565f9a08820cf0d1d3995cfd6488c04d21b64/doc/python/developer.rst#linting installed in the developer environment here and run via pre-commit. Does that satisfy the issue here? Most developers that want to use a container would do best to use this environment.
Yeah, using the development containers is more appropriate for development than the ci images. Thanks!