Skip to content

test: Python 3.11 #528

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

Merged
merged 6 commits into from
Jan 24, 2023
Merged

test: Python 3.11 #528

merged 6 commits into from
Jan 24, 2023

Conversation

texastony
Copy link
Contributor

@texastony texastony commented Jan 23, 2023

Issue #, if available: pyca/cryptography#8115 & Test 3.11

Description of changes:

  • Update Codebuild targets to use latest minor from Pyenv,
    Pyenv now supports using the latest patch for a minor available by just stating the major-minor target.
    At least they do on pyenv @ 2.3.11.
  • Update setup.py to describe Python 3.10 & 3.11 as supported
  • Update GitHub CI to test 3.10 & 3.11
  • Update CodeBuild CI to test 3.11
  • Create a Freeze dependencies 3.11 for Pyca
  • Refactor CodeBuild testing to only test on CB's supported Python versions.
    We were using pyenv to install arbitrary Python versions.
    But I have taken a closer look at what CB is doing, and I have concluded that we should not do that.
    They appear to have customized the builds for their supported runtimes.
    I think our GitHub CI adequately covers Python minor testing.
    We should only use CB testing for integration testing, and use their optimized Python builds.
  • Create a CFN for the CodeBuild project based on what already exists,
    and update the Image to aws/codebuild/amazonlinux2-x86_64-standard:3.0.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@texastony texastony requested a review from a team as a code owner January 23, 2023 20:40
@texastony
Copy link
Contributor Author

Alas, I was wrong about pyenv determining the latest patch for a minor.
While it appears to work on my local,
it does not work on codebuild.
It's not even clear if CodeBuild supports Python 3.11:

[Container] 2023/01/23 20:44:48 Running command pyenv install 3.11
--
python-build: definition not found: 3.11
 
The following versions contain `3.11' in the name:
3.11.0b3
3.11-dev
miniconda3-4.3.11
 
See all available versions with `pyenv install --list'.
 
If the version you need is missing, try upgrading pyenv:
 
cd /root/.pyenv/plugins/python-build/../.. && git pull && cd -

I wonder if I can update pyenv on the Code Build host?

@texastony
Copy link
Contributor Author

texastony commented Jan 23, 2023

This is very interesting:

[Container] 2023/01/23 20:56:43 Entering phase INSTALL
--
[Container] 2023/01/23 20:56:43 Running command cd /root/.pyenv/plugins/python-build/../.. && git pull && cd -
From https://github.com/pyenv/pyenv
c055ba7..96828af  master     -> origin/master
* [new tag]         v2.3.10    -> v2.3.10
* [new tag]         v2.3.11    -> v2.3.11
* [new tag]         v2.3.2     -> v2.3.2
* [new tag]         v2.3.3     -> v2.3.3
* [new tag]         v2.3.4     -> v2.3.4
* [new tag]         v2.3.5     -> v2.3.5
* [new tag]         v2.3.6     -> v2.3.6
* [new tag]         v2.3.7     -> v2.3.7
* [new tag]         v2.3.8     -> v2.3.8
* [new tag]         v2.3.9     -> v2.3.9
error: Your local changes to the following files would be overwritten by merge:
plugins/python-build/share/python-build/3.7.10
plugins/python-build/share/python-build/3.8.10
plugins/python-build/share/python-build/3.9.5
Please commit your changes or stash them before you merge.
Aborting
Updating c055ba7..96828af
 
[Container] 2023/01/23 20:56:44 Command did not exit successfully cd /root/.pyenv/plugins/python-build/../.. && git pull && cd - exit status 1

Python 3.7, 3.8, and 3.9 are the 3 versions AWS CodeBuild publicly supports:
https://docs.aws.amazon.com/codebuild/latest/userguide/runtime-versions.html

It could be they have optimized these versions...
Regardless, we cannot manually update Pyenv in AWS CB
(well, we could try and work around this, but I am not inclined...).

@texastony
Copy link
Contributor Author

For now, I think the best action is to delegate to GitHub CI for Python Minor testing,
and CodeBuild for Integration testing.
As such, I will refactor our Codebuild scripts to not use Pyenv directly,
but to use CB's Python,
and only test on their supported versions.

@texastony
Copy link
Contributor Author

Getting CodeBuild to be optimal would take more time than it's worth.
For now, everything works.

@texastony texastony merged commit a2e993f into aws:master Jan 24, 2023
@texastony texastony deleted the test-feeze-py311 branch January 24, 2023 00:32
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

Successfully merging this pull request may close these issues.

2 participants