CircleCI-Public / cimg-python

The Next-Gen CircleCI Python Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/python
MIT License
32 stars 30 forks source link

Suggestion: multi-python-version images? #178

Closed jclerman closed 1 year ago

jclerman commented 1 year ago

For testing against multiple versions of python, I sometimes use pyenv to add the addtional versions so that I can test against them in multiple tox environments. It would be convenient (and save minutes of build-time) if there were a cimg/python tag that corresponded to an image with multiple versions of python already installed, and selectable via pyenv - say, all of the currently supported python versions (at the moment that's py37 through py311).

Something like adding the following lines to the Dockerfile (where py38 is the base):

RUN pyenv install 3.7.16
RUN pyenv install 3.9.16
RUN pyenv install 3.10.9
RUN pyenv install 3.11.1
RUN pyenv local 3.7.16 3.8.16 3.9.16 3.10.9 3.11.1

Would that be of interest/possible?

JalexChen commented 1 year ago

Hey @jclerman - the convenience images are intended to be deterministic and therefore install only one version. the functionality you're speaking of can be achieved with a matrix build, which you. can read more about here