-
Notifications
You must be signed in to change notification settings - Fork 5
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
Pin Python minor version and document upgrade details #235
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, left some suggestions
docs/app/README.md
Outdated
use semvar versioning, and their [minor releases](https://devguide.python.org/developer-workflow/development-cycle/#devcycle) contain | ||
breaking changes. | ||
|
||
We have this environment configured to use a specific minor version of python just in case anything would break when the yearly release does occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this environment configured to use a specific minor version of python just in case anything would break when the yearly release does occur. | |
Pin to a specific minor version of python just in case anything would break when the yearly release does occur. |
docs/app/README.md
Outdated
|
||
We have this environment configured to use a specific minor version of python just in case anything would break when the yearly release does occur. | ||
|
||
We recommend as a starting point, only pin the minor versions of Python (eg. 3.12), and not the patch versions (eg. 3.12.1) as those contain bug and security fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recommend as a starting point, only pin the minor versions of Python (eg. 3.12), and not the patch versions (eg. 3.12.1) as those contain bug and security fixes. | |
Only pin the minor versions of Python (eg. 3.12), and not the patch versions (eg. 3.12.1) as those contain bug and security fixes. |
docs/app/README.md
Outdated
## Dockerfile | ||
The dockerfile that our API is built from specifies the Python version as the first step. | ||
To upgrade this, simply change the version to the version you would like to use. | ||
|
||
For example, to upgrade from 3.12 to 3.13, change the following line: | ||
```dockerfile | ||
FROM python:3.12-slim AS base | ||
``` | ||
to | ||
```dockerfile | ||
FROM python:3.13-slim AS base | ||
``` | ||
|
||
## Poetry | ||
Adjust the pyproject.toml file line that specifies the version of Python used | ||
to your new version. For example, to upgrade from 3.12 to 3.13, change it from: | ||
|
||
```toml | ||
[tool.poetry.dependencies] | ||
python = "~3.12" | ||
``` | ||
|
||
to | ||
```toml | ||
[tool.poetry.dependencies] | ||
python = "~3.13" | ||
``` | ||
|
||
You will then need to run `poetry lock --no-update` to make the lock file reflect this change. | ||
|
||
## Misc | ||
Some tools, include pyenv, reference the [.python-version](/app/.python-version) file in order to determine which | ||
version of python should be used. Update this to the approach version as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this whole section more concise like:
To upgrade the Python version, make changes in the following places:
1. Local Python version (see more about managing local Python versions in [getting started](/docs/app/getting-started.md))
2. [Dockerfile](/app/Dockerfile)
search for the line `FROM python:3.12-slim as base`
3. [pyproject.toml](/app/pyproject.toml)
search for the line
```
[tool.poetry.dependencies]
python = "~3.12"
```
4. .python-version
I'm trying to think of ways to improve skimmability since this doc is pretty long and I think having a bunch of subheadings might make it harder to skim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can minimize it a bit, but there are some important steps like in the pyproject file needing to run the Poetry command to fix the lock file.
## Summary Fixes #184 ### Time to review: __5 mins__ ## Changes proposed Pin the Python version and document details on how to upgrade Upgraded packages as well while I was tinkering with this ## Context for reviewers This is mirroring changes from the template repo: navapbc/template-application-flask#235 Python releases new minor versions (3.12, 3.13, etc.) every year in October. It usually takes a few weeks for all of our dependencies and tooling to also be upgraded to the latest version, causing our builds to break. There isn't much we can do except wait a few weeks and then do the upgrade (assuming no breaking changes in features we use). However, we had some of our dependencies pinned to the major version (Python 3) so it has broken the past few years until it started working again when the dependencies got fixed. This is just getting ahead of that and making sure the upgrade to Python 3.13 doesn't cause any problems. ## Additional information This change is largely documentation as the Python version used in the dockerfile + pyproject.toml already would have resolved to Python 3.12, this just makes it so it won't auto-upgrade to 3.13 when that releases in October. The package updates are all very minor - we updated them not too long ago, mostly just cleaning up a few things like the types-requests issue that is no longer present.
Fixes HHS#2035 Pin the Python version and document details on how to upgrade Upgraded packages as well while I was tinkering with this This is mirroring changes from the template repo: navapbc/template-application-flask#235 Python releases new minor versions (3.12, 3.13, etc.) every year in October. It usually takes a few weeks for all of our dependencies and tooling to also be upgraded to the latest version, causing our builds to break. There isn't much we can do except wait a few weeks and then do the upgrade (assuming no breaking changes in features we use). However, we had some of our dependencies pinned to the major version (Python 3) so it has broken the past few years until it started working again when the dependencies got fixed. This is just getting ahead of that and making sure the upgrade to Python 3.13 doesn't cause any problems. This change is largely documentation as the Python version used in the dockerfile + pyproject.toml already would have resolved to Python 3.12, this just makes it so it won't auto-upgrade to 3.13 when that releases in October. The package updates are all very minor - we updated them not too long ago, mostly just cleaning up a few things like the types-requests issue that is no longer present.
Fixes HHS#2035 Pin the Python version and document details on how to upgrade Upgraded packages as well while I was tinkering with this This is mirroring changes from the template repo: navapbc/template-application-flask#235 Python releases new minor versions (3.12, 3.13, etc.) every year in October. It usually takes a few weeks for all of our dependencies and tooling to also be upgraded to the latest version, causing our builds to break. There isn't much we can do except wait a few weeks and then do the upgrade (assuming no breaking changes in features we use). However, we had some of our dependencies pinned to the major version (Python 3) so it has broken the past few years until it started working again when the dependencies got fixed. This is just getting ahead of that and making sure the upgrade to Python 3.13 doesn't cause any problems. This change is largely documentation as the Python version used in the dockerfile + pyproject.toml already would have resolved to Python 3.12, this just makes it so it won't auto-upgrade to 3.13 when that releases in October. The package updates are all very minor - we updated them not too long ago, mostly just cleaning up a few things like the types-requests issue that is no longer present.
…c#185) Fixes #2035 Pin the Python version and document details on how to upgrade Upgraded packages as well while I was tinkering with this This is mirroring changes from the template repo: navapbc/template-application-flask#235 Python releases new minor versions (3.12, 3.13, etc.) every year in October. It usually takes a few weeks for all of our dependencies and tooling to also be upgraded to the latest version, causing our builds to break. There isn't much we can do except wait a few weeks and then do the upgrade (assuming no breaking changes in features we use). However, we had some of our dependencies pinned to the major version (Python 3) so it has broken the past few years until it started working again when the dependencies got fixed. This is just getting ahead of that and making sure the upgrade to Python 3.13 doesn't cause any problems. This change is largely documentation as the Python version used in the dockerfile + pyproject.toml already would have resolved to Python 3.12, this just makes it so it won't auto-upgrade to 3.13 when that releases in October. The package updates are all very minor - we updated them not too long ago, mostly just cleaning up a few things like the types-requests issue that is no longer present.
Changes
Pin the Python version and document details on how to upgrade
Context for reviewers
Python releases new minor versions (3.12, 3.13, etc.) every year in October. It usually takes a few weeks for all of our dependencies and tooling to also be upgraded to the latest version, causing our builds to break. There isn't much we can do except wait a few weeks and then do the upgrade (assuming no breaking changes in features we use).
However, we had some of our dependencies pinned to the major version (Python 3) so it has broken the past few years until it started working again when the dependencies got fixed. This is just getting ahead of that and making sure the upgrade to Python 3.13 doesn't cause any problems.
Testing
This change is largely documentation as the Python version used in the dockerfile + pyproject.toml already would have resolved to Python 3.12, this just makes it so it won't auto-upgrade to 3.13 when that releases in October.