From cee5f8344019298f8fe77b1d29f5ee7aec3f28dc Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Sat, 7 Sep 2024 19:50:45 +0000 Subject: [PATCH] Add support for Python 3.8.20, 3.9.20, 3.10.15, 3.11.10 and 3.12.6 (#1632) Release notes: https://blog.python.org/2024/09/python-3130rc2-3126-31110-31015-3920.html Changelogs: https://docs.python.org/release/3.8.20/whatsnew/changelog.html#python-3-8-20-final https://docs.python.org/release/3.9.20/whatsnew/changelog.html#python-3-9-20-final https://docs.python.org/release/3.10.15/whatsnew/changelog.html#python-3-10-15-final https://docs.python.org/release/3.11.10/whatsnew/changelog.html#python-3-11-10-final https://docs.python.org/release/3.12.6/whatsnew/changelog.html#python-3-12-6-final Binary builds: https://github.com/heroku/heroku-buildpack-python/actions/runs/10750205053/job/29818038722 https://github.com/heroku/heroku-buildpack-python/actions/runs/10751132694/job/29818059983 https://github.com/heroku/heroku-buildpack-python/actions/runs/10750206118 https://github.com/heroku/heroku-buildpack-python/actions/runs/10750206743 https://github.com/heroku/heroku-buildpack-python/actions/runs/10750207733 GUS-W-16690151. --- CHANGELOG.md | 2 ++ README.md | 12 ++++++------ bin/default_pythons | 10 +++++----- spec/fixtures/pipenv_and_runtime_txt/runtime.txt | 2 +- spec/fixtures/python_3.10/runtime.txt | 2 +- spec/fixtures/python_3.11/runtime.txt | 2 +- spec/fixtures/python_3.12/runtime.txt | 2 +- spec/fixtures/python_3.8/runtime.txt | 2 +- spec/fixtures/python_3.9/runtime.txt | 2 +- spec/fixtures/runtime_txt_only/runtime.txt | 2 +- .../runtime_txt_with_stray_whitespace/runtime.txt | 2 +- spec/hatchet/python_version_spec.rb | 12 ++++++------ spec/spec_helper.rb | 10 +++++----- 13 files changed, 32 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f7963c0c..223288c17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +- Added support for Python 3.8.20, 3.9.20, 3.10.15, 3.11.10 and 3.12.6. ([#1632](https://github.com/heroku/heroku-buildpack-python/pull/1632)) +- Changed the default Python version for new apps from 3.12.5 to 3.12.6. ([#1632](https://github.com/heroku/heroku-buildpack-python/pull/1632)) - Updated wheel from 0.43.0 to 0.44.0. ([#1629](https://github.com/heroku/heroku-buildpack-python/pull/1629)) ## [v255] - 2024-08-07 diff --git a/README.md b/README.md index e5196f197..82b93df63 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ A `requirements.txt` must be present at the root of your application's repositor To specify your python version, you also need a `runtime.txt` file - unless you are using the default Python runtime version. -Current default Python Runtime: Python 3.12.5 +Current default Python Runtime: Python 3.12.6 Alternatively, you can provide a `setup.py` file, or a `Pipfile`. Using `pipenv` will generate `runtime.txt` at build time if one of the field `python_version` or `python_full_version` is specified in the `requires` section of your `Pipfile`. @@ -60,8 +60,8 @@ Specify a Python Runtime Supported runtime options include: -- `python-3.12.5` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details) -- `python-3.11.9` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details) -- `python-3.10.14` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details) -- `python-3.9.19` on Heroku-20 and Heroku-22 only -- `python-3.8.19` on Heroku-20 only +- `python-3.12.6` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details) +- `python-3.11.10` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details) +- `python-3.10.15` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details) +- `python-3.9.20` on Heroku-20 and Heroku-22 only +- `python-3.8.20` on Heroku-20 only diff --git a/bin/default_pythons b/bin/default_pythons index 70e1dd730..30bd0b34c 100755 --- a/bin/default_pythons +++ b/bin/default_pythons @@ -5,11 +5,11 @@ # the env vars to subprocesses. # shellcheck disable=2034 -LATEST_312="python-3.12.5" -LATEST_311="python-3.11.9" -LATEST_310="python-3.10.14" -LATEST_39="python-3.9.19" -LATEST_38="python-3.8.19" +LATEST_312="python-3.12.6" +LATEST_311="python-3.11.10" +LATEST_310="python-3.10.15" +LATEST_39="python-3.9.20" +LATEST_38="python-3.8.20" # TODO: Remove these EOL versions once pipenv-python-version is refactored. LATEST_37="python-3.7.17" LATEST_36="python-3.6.15" diff --git a/spec/fixtures/pipenv_and_runtime_txt/runtime.txt b/spec/fixtures/pipenv_and_runtime_txt/runtime.txt index 8a7cba521..32bcba665 100644 --- a/spec/fixtures/pipenv_and_runtime_txt/runtime.txt +++ b/spec/fixtures/pipenv_and_runtime_txt/runtime.txt @@ -1 +1 @@ -python-3.12.5 +python-3.12.6 diff --git a/spec/fixtures/python_3.10/runtime.txt b/spec/fixtures/python_3.10/runtime.txt index 2bccd9d9d..bb60b7f69 100644 --- a/spec/fixtures/python_3.10/runtime.txt +++ b/spec/fixtures/python_3.10/runtime.txt @@ -1 +1 @@ -python-3.10.14 +python-3.10.15 diff --git a/spec/fixtures/python_3.11/runtime.txt b/spec/fixtures/python_3.11/runtime.txt index 546f3c8de..e34519556 100644 --- a/spec/fixtures/python_3.11/runtime.txt +++ b/spec/fixtures/python_3.11/runtime.txt @@ -1 +1 @@ -python-3.11.9 +python-3.11.10 diff --git a/spec/fixtures/python_3.12/runtime.txt b/spec/fixtures/python_3.12/runtime.txt index 8a7cba521..32bcba665 100644 --- a/spec/fixtures/python_3.12/runtime.txt +++ b/spec/fixtures/python_3.12/runtime.txt @@ -1 +1 @@ -python-3.12.5 +python-3.12.6 diff --git a/spec/fixtures/python_3.8/runtime.txt b/spec/fixtures/python_3.8/runtime.txt index 96307d57b..7494875b9 100644 --- a/spec/fixtures/python_3.8/runtime.txt +++ b/spec/fixtures/python_3.8/runtime.txt @@ -1 +1 @@ -python-3.8.19 +python-3.8.20 diff --git a/spec/fixtures/python_3.9/runtime.txt b/spec/fixtures/python_3.9/runtime.txt index 4458b433c..57f558859 100644 --- a/spec/fixtures/python_3.9/runtime.txt +++ b/spec/fixtures/python_3.9/runtime.txt @@ -1 +1 @@ -python-3.9.19 +python-3.9.20 diff --git a/spec/fixtures/runtime_txt_only/runtime.txt b/spec/fixtures/runtime_txt_only/runtime.txt index 8a7cba521..32bcba665 100644 --- a/spec/fixtures/runtime_txt_only/runtime.txt +++ b/spec/fixtures/runtime_txt_only/runtime.txt @@ -1 +1 @@ -python-3.12.5 +python-3.12.6 diff --git a/spec/fixtures/runtime_txt_with_stray_whitespace/runtime.txt b/spec/fixtures/runtime_txt_with_stray_whitespace/runtime.txt index 8e4f9da34..b7e93bdc0 100644 --- a/spec/fixtures/runtime_txt_with_stray_whitespace/runtime.txt +++ b/spec/fixtures/runtime_txt_with_stray_whitespace/runtime.txt @@ -1,3 +1,3 @@ - python-3.12.5 + python-3.12.6 \ No newline at end of file diff --git a/spec/hatchet/python_version_spec.rb b/spec/hatchet/python_version_spec.rb index e93946c56..f4d96c376 100644 --- a/spec/hatchet/python_version_spec.rb +++ b/spec/hatchet/python_version_spec.rb @@ -132,12 +132,12 @@ end end - context 'when runtime.txt contains python-3.8.19' do + context 'when runtime.txt contains python-3.8.20' do let(:allow_failure) { false } let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.8', allow_failure:) } context 'when using Heroku-20', stacks: %w[heroku-20] do - it 'builds with Python 3.8.19 but shows a deprecation warning' do + it 'builds with Python 3.8.20 but shows a deprecation warning' do app.deploy do |app| expect(clean_output(app.output)).to include(<<~OUTPUT) remote: -----> Python app detected @@ -171,7 +171,7 @@ end end - context 'when runtime.txt contains python-3.9.19' do + context 'when runtime.txt contains python-3.9.20' do let(:allow_failure) { false } let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.9', allow_failure:) } @@ -187,19 +187,19 @@ end end - context 'when runtime.txt contains python-3.10.14' do + context 'when runtime.txt contains python-3.10.15' do let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.10') } include_examples 'builds with the requested Python version', LATEST_PYTHON_3_10 end - context 'when runtime.txt contains python-3.11.9' do + context 'when runtime.txt contains python-3.11.10' do let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.11') } include_examples 'builds with the requested Python version', LATEST_PYTHON_3_11 end - context 'when runtime.txt contains python-3.12.5' do + context 'when runtime.txt contains python-3.12.6' do let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.12') } include_examples 'builds with the requested Python version', LATEST_PYTHON_3_12 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7518287af..6d72bc8ee 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,11 +7,11 @@ require 'rspec/retry' require 'hatchet' -LATEST_PYTHON_3_8 = '3.8.19' -LATEST_PYTHON_3_9 = '3.9.19' -LATEST_PYTHON_3_10 = '3.10.14' -LATEST_PYTHON_3_11 = '3.11.9' -LATEST_PYTHON_3_12 = '3.12.5' +LATEST_PYTHON_3_8 = '3.8.20' +LATEST_PYTHON_3_9 = '3.9.20' +LATEST_PYTHON_3_10 = '3.10.15' +LATEST_PYTHON_3_11 = '3.11.10' +LATEST_PYTHON_3_12 = '3.12.6' DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_12 # The requirement versions are effectively buildpack constants, however, we want