Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Update python versions #19

Merged
merged 5 commits into from
Nov 28, 2023
Merged

Update python versions #19

merged 5 commits into from
Nov 28, 2023

Conversation

zaro0508
Copy link
Contributor

Python 3.7 support has been dropped[1] so remove that and update the other supported python versions

[1] Sceptre/sceptre#1382

Python 3.7 support has been dropped[1] so remove that and
update the other supported python versions

[1] Sceptre/sceptre#1382
@iainelder
Copy link

Thanks for sharing. I'll have a closer look through the week.

Dockerfile Show resolved Hide resolved
Dockerfile Outdated
&& pyenv install 3.9.16 \
&& pyenv install 3.10.9 \
&& pyenv install 3.11.1 \
&& pyenv global system 3.8.16 3.9.16 3.10.9 3.11.1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you choose the patch version?

Your commits said that CircleCI coudn't find some other patch versions.

Does it matter that none of these are the current latest patch version?

$ pyenv latest --known 3.8
3.8.18
$ pyenv latest --known 3.9
3.9.18
$ pyenv latest --known 3.10
3.10.13
$ pyenv latest --known 3.11
3.11.6

Copy link
Contributor Author

@zaro0508 zaro0508 Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iainelder hmm, this is what I get..

➜  pyenv latest --known 3.10
3.10.10

I get the same result when i run ➜ pyenv install --list|grep 3.10

maybe we have different versions of pyenv? or maybe i'm on a MAC?

➜  pyenv --version
pyenv 2.3.25

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This time I don't think the operating system matters, but the pyenv version certainly does.

My pyenv version is 2.3.32. That's the latest version. I ran pyenv update just before I checked this.

The pyenv version in the Docker image is what matters most.

Base image cimg/python:3.11-node has pyenv version 2.3.8.

Base image cimg/python:3.12-node has pyenv version 2.3.29.

This table shows, for each Python feature version that Sceptre supports, the latest bugfix version that each pyenv version can install.

Feature Pyenv 2.3.8 latest Pyenv 2.3.29 latest
3.7 16 17
3.8 16 18
3.9 16 18
3.10 9 13
3.11 1 6

Copy link

@iainelder iainelder Nov 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't need the absolute latest bugfix version, then we can just use CircleCI's chosen pyenv version.

Unless we care about the exact bugfix version number, we don't have to write them in the Dockerfile. We can use compound pyenv commands to install whatever latest version it knows about.

So the Dockerfile would look like this:

RUN pyenv install $(pyenv latest --known 3.8)
RUN pyenv install $(pyenv latest --known 3.9)
RUN pyenv install $(pyenv latest --known 3.10)
RUN pyenv install $(pyenv latest --known 3.11)
RUN pyenv global system $(pyenv versions --bare)

I built it locally and reported the Python versions available to pyenv:

$ docker run -it --rm 1fb7c2f153d2 pyenv versions
* system (set by /home/circleci/.pyenv/version)
* 3.8.18 (set by /home/circleci/.pyenv/version)
* 3.9.18 (set by /home/circleci/.pyenv/version)
* 3.10.13 (set by /home/circleci/.pyenv/version)
* 3.11.6 (set by /home/circleci/.pyenv/version)
* 3.12.0 (set by /home/circleci/.pyenv/version)

I believe writing the Dockerfile this way would allow us to use the next bugfix version automatically whenever CircleCI updates their base image. Then we would never need to manage the bugfix versions again in this file. We would change this file only when Sceptre's supported feature versions change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good suggestion. thanks.

Dockerfile Outdated Show resolved Hide resolved
Co-authored-by: Iain Samuel McLean Elder <[email protected]>
Copy link

@iainelder iainelder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@zaro0508 zaro0508 merged commit 5465326 into Sceptre:master Nov 28, 2023
2 checks passed
zaro0508 added a commit to zaro0508/sceptre that referenced this pull request Nov 28, 2023
Update circleci docker container with python 3.7 removed
and python 3.12 added

depends on Sceptre/sceptre-circleci#19
zaro0508 added a commit to zaro0508/sceptre that referenced this pull request Nov 28, 2023
Update circleci docker container with python 3.7 removed
and python 3.12 added

depends on Sceptre/sceptre-circleci#19
zaro0508 added a commit to Sceptre/sceptre that referenced this pull request Dec 2, 2023
Update circleci docker container with python 3.7 removed and python 3.12 added

depends on Sceptre/sceptre-circleci#19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants