Skip to content

Commit ffd66f3

Browse files
authored
Add buildpack support for Heroku-26 (#2073)
Following on from #2056 (which added support for building and releasing Python binaries for Heroku-26), this adds support for the new stack to the buildpack itself. Note: Since Ubuntu 26.04 isn't GA yet, Heroku-26 is currently only available on Heroku for use by internal users. GUS-W-20775616.
1 parent 240f6b8 commit ffd66f3

File tree

11 files changed

+39
-25
lines changed

11 files changed

+39
-25
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
stack: ["heroku-22", "heroku-24"]
42+
stack: ["heroku-22", "heroku-24", "heroku-26"]
4343
env:
4444
HATCHET_APP_LIMIT: 300
4545
HATCHET_DEFAULT_STACK: ${{ matrix.stack }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Added support for Heroku-26. ([#2073](https://github.com/heroku/heroku-buildpack-python/pull/2073))
56

67
## [v341] - 2026-04-07
78

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# These targets are not files
22
.PHONY: lint lint-scripts lint-ruby check-format format run publish
33

4-
STACK ?= heroku-24
4+
STACK ?= heroku-26
55
FIXTURE ?= spec/fixtures/python_version_unspecified
66
# Allow overriding the exit code in CI, so we can test bin/report works for failing builds.
77
COMPILE_FAILURE_EXIT_CODE ?= 1

lib/checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function checks::ensure_supported_stack() {
44
local stack="${1}"
55

66
case "${stack}" in
7-
heroku-22 | heroku-24)
7+
heroku-22 | heroku-24 | heroku-26)
88
return 0
99
;;
1010
cedar* | heroku-16 | heroku-18 | heroku-20)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13.2
1+
3.14.0

spec/hatchet/pipenv_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,10 @@
455455
end
456456
end
457457

458-
context 'when the Pipenv and Python versions have changed since the last build' do
458+
# TODO: Enable on Heroku-26 after the Pipenv and default Python versions next change,
459+
# since for now there isn't a historic buildpack version we can use in this test whose
460+
# stack check permits Heroku-26 and that also uses older Pipenv/Python versions.
461+
context 'when the Pipenv and Python versions have changed since the last build', stacks: %w[heroku-22 heroku-24] do
459462
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v313'] }
460463
let(:app) { Hatchet::Runner.new('spec/fixtures/pipenv_basic', buildpacks:) }
461464

spec/hatchet/poetry_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@
131131
end
132132
end
133133

134-
context 'when the Poetry and Python versions have changed since the last build' do
134+
# TODO: Enable on Heroku-26 after the Poetry and default Python versions next change,
135+
# since for now there isn't a historic buildpack version we can use in this test whose
136+
# stack check permits Heroku-26 and that also uses older Poetry/Python versions.
137+
context 'when the Poetry and Python versions have changed since the last build', stacks: %w[heroku-22 heroku-24] do
135138
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v313'] }
136139
let(:app) { Hatchet::Runner.new('spec/fixtures/poetry_basic', buildpacks:) }
137140

spec/hatchet/python_version_spec.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,21 @@
8888
end
8989
end
9090

91-
context 'with an app last built using an older default Python version' do
91+
# TODO: Enable on Heroku-26 after the default Python version next changes (for the 3.14.5
92+
# release), since for now there isn't a historic buildpack version we can use in this test
93+
# whose stack check permits Heroku-26 and also has a different default Python version so
94+
# that we can test the sticky versions feature.
95+
context 'with an app last built using an older default Python version', stacks: %w[heroku-22 heroku-24] do
9296
# This test performs an initial build using an older buildpack version, followed
9397
# by a build using the current version. This ensures that:
9498
# - The current buildpack can successfully read the version metadata
9599
# written to the build cache by older buildpack versions.
96100
# - If no Python version is specified, the same major version as the
97-
# last build is used (sticky versioning).
101+
# last build is used (sticky major versioning).
98102
# - Changes in the pip version are handled correctly.
99103
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v267'] }
100104

101-
it 'builds with the same Python version as the last build' do
105+
it 'builds with the same major Python version as the last build' do
102106
app.deploy do |app|
103107
update_buildpacks(app, [:default])
104108
app.commit!
@@ -566,25 +570,25 @@
566570
app.deploy do |app|
567571
expect(clean_output(app.output)).to include(<<~OUTPUT)
568572
remote: -----> Python app detected
569-
remote: -----> Using Python 3.13.2 specified in .python-version
573+
remote: -----> Using Python 3.14.0 specified in .python-version
570574
remote:
571575
remote: ! Warning: A Python patch update is available!
572576
remote: !
573-
remote: ! Your app is using Python 3.13.2, however, there is a newer
574-
remote: ! patch release of Python 3.13 available: #{LATEST_PYTHON_3_13}
577+
remote: ! Your app is using Python 3.14.0, however, there is a newer
578+
remote: ! patch release of Python 3.14 available: #{LATEST_PYTHON_3_14}
575579
remote: !
576580
remote: ! It is important to always use the latest patch version of
577581
remote: ! Python to keep your app secure.
578582
remote: !
579583
remote: ! Update your .python-version file to use the new version.
580584
remote: !
581585
remote: ! We strongly recommend that you don't pin your app to an
582-
remote: ! exact Python version such as 3.13.2, and instead only specify
583-
remote: ! the major Python version of 3.13 in your .python-version file.
586+
remote: ! exact Python version such as 3.14.0, and instead only specify
587+
remote: ! the major Python version of 3.14 in your .python-version file.
584588
remote: ! This will allow your app to receive the latest available Python
585589
remote: ! patch version automatically and prevent this warning.
586590
remote:
587-
remote: -----> Installing Python 3.13.2
591+
remote: -----> Installing Python 3.14.0
588592
remote: -----> Installing pip #{PIP_VERSION}
589593
OUTPUT
590594
end

spec/hatchet/stack_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_relative '../spec_helper'
44

55
RSpec.describe 'Stack changes' do
6-
context 'when the stack is upgraded from Heroku-22 to Heroku-24', stacks: %w[heroku-22] do
6+
context 'when the stack is upgraded from Heroku-24 to Heroku-26', stacks: %w[heroku-24] do
77
# This test performs an initial build using an older buildpack version, followed by a build
88
# using the current version. This ensures that the current buildpack can successfully read
99
# the stack metadata written to the build cache in the past. The buildpack version chosen is
@@ -14,8 +14,8 @@
1414

1515
it 'clears the cache before installing again whilst preserving the sticky Python version' do
1616
app.deploy do |app|
17-
expect(app.output).to include('Building on the Heroku-22 stack')
18-
app.update_stack('heroku-24')
17+
expect(app.output).to include('Building on the Heroku-24 stack')
18+
app.update_stack('heroku-26')
1919
update_buildpacks(app, [:default])
2020
app.commit!
2121
app.push!
@@ -64,7 +64,7 @@
6464
remote: ! file and this warning will be made an error.
6565
remote:
6666
remote: -----> Discarding cache since:
67-
remote: - The stack has changed from heroku-22 to heroku-24
67+
remote: - The stack has changed from heroku-24 to heroku-26
6868
remote: - The Python version has changed from 3.12.3 to #{LATEST_PYTHON_3_12}
6969
remote: - The buildpack cache format has changed
7070
remote: - The legacy SQLite3 headers and CLI binary need to be uninstalled
@@ -77,20 +77,20 @@
7777
end
7878
end
7979

80-
context 'when the stack is downgraded from Heroku-24 to Heroku-22', stacks: %w[heroku-24] do
80+
context 'when the stack is downgraded from Heroku-26 to Heroku-24', stacks: %w[heroku-26] do
8181
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.14') }
8282

8383
it 'clears the cache before installing again' do
8484
app.deploy do |app|
85-
expect(app.output).to include('Building on the Heroku-24 stack')
86-
app.update_stack('heroku-22')
85+
expect(app.output).to include('Building on the Heroku-26 stack')
86+
app.update_stack('heroku-24')
8787
app.commit!
8888
app.push!
8989
expect(clean_output(app.output)).to include(<<~OUTPUT)
9090
remote: -----> Python app detected
9191
remote: -----> Using Python 3.14 specified in .python-version
9292
remote: -----> Discarding cache since:
93-
remote: - The stack has changed from heroku-24 to heroku-22
93+
remote: - The stack has changed from heroku-26 to heroku-24
9494
remote: -----> Installing Python #{LATEST_PYTHON_3_14}
9595
remote: -----> Installing pip #{PIP_VERSION}
9696
remote: -----> Installing dependencies using 'pip install -r requirements.txt'

spec/hatchet/uv_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@
128128
end
129129
end
130130

131-
context 'when the uv and Python versions have changed since the last build' do
131+
# TODO: Enable on Heroku-26 after the uv and default Python versions next change,
132+
# since for now there isn't a historic buildpack version we can use in this test
133+
# whose stack check permits Heroku-26 and that also uses older uv/Python versions.
134+
context 'when the uv and Python versions have changed since the last build', stacks: %w[heroku-22 heroku-24] do
132135
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v313'] }
133136
let(:app) { Hatchet::Runner.new('spec/fixtures/uv_basic', buildpacks:) }
134137

0 commit comments

Comments
 (0)