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

Add support for Python 3.7.16, 3.8.16, 3.9.16, 3.10.9 and 3.11.1 #1392

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## Unreleased


## v224 (2022-12-07)

- Python 3.7.16, 3.8.16, 3.9.16, 3.10.9 and 3.11.1 are now available ([#1392](https://github.com/heroku/heroku-buildpack-python/pull/1392)).
- The default Python version for new apps is now 3.10.9 (previously 3.10.8) ([#1392](https://github.com/heroku/heroku-buildpack-python/pull/1392)).

## v223 (2022-11-07)

- Update pip from 22.2.2 to 22.3.1 for Python 3.7+ ([#1387](https://github.com/heroku/heroku-buildpack-python/pull/1387)).
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.8
Current default Python Runtime: Python 3.10.9

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`.
Expand All @@ -60,8 +60,8 @@ Specify a Python Runtime

Supported runtime options include:

- `python-3.11.0` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details)
- `python-3.10.8` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details)
- `python-3.9.15` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details)
- `python-3.8.15` on Heroku-18 and Heroku-20 only
- `python-3.7.15` on Heroku-18 and Heroku-20 only
- `python-3.11.1` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details)
- `python-3.10.9` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details)
- `python-3.9.16` on all [supported stacks](https://devcenter.heroku.com/articles/stack#stack-support-details)
- `python-3.8.16` on Heroku-18 and Heroku-20 only
- `python-3.7.16` on Heroku-18 and Heroku-20 only
10 changes: 5 additions & 5 deletions bin/default_pythons
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# the env vars to subprocesses.
# shellcheck disable=2034

LATEST_311="python-3.11.0"
LATEST_310="python-3.10.8"
LATEST_39="python-3.9.15"
LATEST_38="python-3.8.15"
LATEST_37="python-3.7.15"
LATEST_311="python-3.11.1"
LATEST_310="python-3.10.9"
LATEST_39="python-3.9.16"
LATEST_38="python-3.8.16"
LATEST_37="python-3.7.16"
LATEST_36="python-3.6.15"
# TODO: Remove these EOL versions once pipenv-python-version is refactored.
LATEST_35="python-3.5.10"
Expand Down
5 changes: 5 additions & 0 deletions builds/runtimes/python-3.10.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python

# shellcheck source-path=SCRIPTDIR
source "$(dirname "${0}")/python"
5 changes: 5 additions & 0 deletions builds/runtimes/python-3.11.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python

# shellcheck source-path=SCRIPTDIR
source "$(dirname "${0}")/python"
5 changes: 5 additions & 0 deletions builds/runtimes/python-3.7.16
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python

# shellcheck source-path=SCRIPTDIR
source "$(dirname "${0}")/python"
5 changes: 5 additions & 0 deletions builds/runtimes/python-3.8.16
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python

# shellcheck source-path=SCRIPTDIR
source "$(dirname "${0}")/python"
5 changes: 5 additions & 0 deletions builds/runtimes/python-3.9.16
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python

# shellcheck source-path=SCRIPTDIR
source "$(dirname "${0}")/python"
2 changes: 1 addition & 1 deletion spec/fixtures/ci_nose/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.15
python-3.9.16
2 changes: 1 addition & 1 deletion spec/fixtures/pipenv_and_runtime_txt/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.10.8
python-3.10.9
2 changes: 1 addition & 1 deletion spec/fixtures/python_3.10/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.10.8
python-3.10.9
2 changes: 1 addition & 1 deletion spec/fixtures/python_3.11/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.11.0
python-3.11.1
Empty file.
1 change: 1 addition & 0 deletions spec/fixtures/python_3.11_outdated/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.11.0
2 changes: 1 addition & 1 deletion spec/fixtures/python_3.7/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.15
python-3.7.16
2 changes: 1 addition & 1 deletion spec/fixtures/python_3.8/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.8.15
python-3.8.16
2 changes: 1 addition & 1 deletion spec/fixtures/python_3.9/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.15
python-3.9.16
2 changes: 1 addition & 1 deletion spec/fixtures/runtime_txt_only/runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.10.8
python-3.10.9
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

python-3.10.8
python-3.10.9

7 changes: 6 additions & 1 deletion spec/hatchet/python_update_warning_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,10 @@
include_examples 'warns there is a Python update available', '3.10.5', LATEST_PYTHON_3_10
end

# TODO: Add a test for Python 3.11.0 once 3.11.1 is released.
context 'with a runtime.txt containing python-3.11.0' do
let(:allow_failure) { false }
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.11_outdated', allow_failure: allow_failure) }

include_examples 'warns there is a Python update available', '3.11.0', LATEST_PYTHON_3_11
end
end
10 changes: 5 additions & 5 deletions spec/hatchet/python_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
end
end

context 'when runtime.txt contains python-3.7.15' do
context 'when runtime.txt contains python-3.7.16' do
let(:allow_failure) { false }
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.7', allow_failure: allow_failure) }

Expand All @@ -231,7 +231,7 @@
end
end

context 'when runtime.txt contains python-3.8.15' do
context 'when runtime.txt contains python-3.8.16' do
let(:allow_failure) { false }
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.8', allow_failure: allow_failure) }

Expand All @@ -247,19 +247,19 @@
end
end

context 'when runtime.txt contains python-3.9.15' do
context 'when runtime.txt contains python-3.9.16' do
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.9') }

include_examples 'builds with the requested Python version', LATEST_PYTHON_3_9
end

context 'when runtime.txt contains python-3.10.8' do
context 'when runtime.txt contains python-3.10.9' 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.0' do
context 'when runtime.txt contains python-3.11.1' do
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.11') }

include_examples 'builds with the requested Python version', LATEST_PYTHON_3_11
Expand Down
10 changes: 5 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
require 'hatchet'

LATEST_PYTHON_3_6 = '3.6.15'
LATEST_PYTHON_3_7 = '3.7.15'
LATEST_PYTHON_3_8 = '3.8.15'
LATEST_PYTHON_3_9 = '3.9.15'
LATEST_PYTHON_3_10 = '3.10.8'
LATEST_PYTHON_3_11 = '3.11.0'
LATEST_PYTHON_3_7 = '3.7.16'
LATEST_PYTHON_3_8 = '3.8.16'
LATEST_PYTHON_3_9 = '3.9.16'
LATEST_PYTHON_3_10 = '3.10.9'
LATEST_PYTHON_3_11 = '3.11.1'
DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_10

# Work around the return value for `default_buildpack` changing after deploy:
Expand Down