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

Move to Python 3.12 #818

Open
7 tasks
stvnrlly opened this issue Feb 26, 2024 · 0 comments
Open
7 tasks

Move to Python 3.12 #818

stvnrlly opened this issue Feb 26, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation engineering python Pull requests that update Python code

Comments

@stvnrlly
Copy link
Collaborator

stvnrlly commented Feb 26, 2024

Our applications currently run on Python 3.9. This will no longer be supported before too long, so we want to move to 3.12, the current stable release.

All 3 repositories will need this upgrade:

  • notifications-api
  • notifications-admin
  • notifications-utils

While doing this, we want to change other pieces only if necessary to make this upgrade.

Implementation Sketch and Acceptance Criteria

We're going to start with the notifications-utils repo for this work because it's smaller in size and a dependency for the API and admin.

There is also some open work for utils already in place to help with this effort: @terrazoon has created a PR to replace the orderedset library with the ordered_set library instead. This is a necessary step as a part of the Python update, and there may be others like it in the future.

(There is a corresponding admin PR to update this dependency as well, however it will need to be updated to reference the right version of notification-utils once that update is complete.)

It's a bit unclear what actually has to happen, but I suspect the following steps to start with:

  • Installing the newest version of Python 3.12 on to your system with pyenv
  • Creating a new virtual environment with the 3.12 installation
  • Updating pyproject.toml to reference Pythong 3.12 instead of 3.9.x
  • Telling Poetry to use the new virtual environment
  • Running make bootstrap to get all dependencies loaded and seeing if anything breaks
  • Running the tests and seeing if anything breaks
  • Running the application and seeing if anything breaks (if possible)

We should only update other dependencies as absolutely necessary for now. While it's tempting to update all-the-things, that will be difficult to debug should things not work correctly! Furthermore, we may have to take a step-wise approach to this, meaning we update from 3.9 to 3.10 first, then 3.10 to 3.11, and so on.

At a high level, what we need with this update are the following:

  • Python is updated to 3.12; make note if we have to step through the previous versions first to get there
  • The application runs correctly, or the library is loaded correctly as a dependency (in the case of notifications-utils)
  • The tests all run and pass
  • Any required dependency updates are accounted for

Security Considerations

  • Python 3.9 is starting to approach critical updates only, and will soon be the oldest supported version in the Python Cloud Foundry Buildpack - we'd like to move ahead of this before we absolutely have to.
  • Newer versions of Python contain additional enhancements and improvements; they're also required for working with things like the newer versions of OpenSSL, which are required for FIPS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation engineering python Pull requests that update Python code
Projects
Status: Done
Development

No branches or pull requests

3 participants