Skip to content

Commit

Permalink
Use Python 3.9 as the default Python version for new apps
Browse files Browse the repository at this point in the history
Previously if a new app did not specify a Python version via a
`runtime.txt` or the appropriate `Pipfile` config option, then
the buildpack would default to Python 3.6.13.

Now the buildpack will use Python 3.9.2.

This does not affect:
* apps that specify an explicit Python version
* existing apps that have already had a build using
  the previous default version (since that version is
  remembered from one build to the next, via the
  "sticky versions" feature).

Use-cases involving new apps that aren't compatible with
Python 3.9 will now need to specify Python 3.6 explicitly:
https://devcenter.heroku.com/articles/python-support#specifying-a-python-version

Closes GUS-W-7686321.
  • Loading branch information
edmorley committed Apr 1, 2021
1 parent d044f56 commit d5459f9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Use Python 3.9.2 as the default Python version for new apps (previously Python 3.6.13) ([#1187](https://github.com/heroku/heroku-buildpack-python/pull/1187)).
- Remove Airflow `SLUGIFY_USES_TEXT_UNIDECODE` workaround ([#1186](https://github.com/heroku/heroku-buildpack-python/pull/1186)).
- Fix grammar in the Python 2 EOL message ([#1182](https://github.com/heroku/heroku-buildpack-python/pull/1182)).

Expand Down
2 changes: 1 addition & 1 deletion 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.6.12
Current default Python Runtime: Python 3.9.2

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 Down
2 changes: 1 addition & 1 deletion bin/default_pythons
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ LATEST_34="python-3.4.10"
LATEST_27="python-2.7.18"
LATEST_PYPY_36="pypy3.6-7.3.2"
LATEST_PYPY_27="pypy2.7-7.3.2"
DEFAULT_PYTHON_VERSION="${LATEST_36}"
DEFAULT_PYTHON_VERSION="${LATEST_39}"
2 changes: 1 addition & 1 deletion spec/hatchet/nltk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
expect(clean_output(app.output)).to match(Regexp.new(<<~REGEX))
remote: -----> Downloading NLTK corpora…
remote: -----> Downloading NLTK packages: city_database stopwords
remote: /app/.heroku/python/lib/python3.6/runpy.py:125: RuntimeWarning: 'nltk.downloader' found in sys.modules after import of package 'nltk', but prior to execution of 'nltk.downloader'; this may result in unpredictable behaviour
remote: .*: RuntimeWarning: 'nltk.downloader' found in sys.modules after import of package 'nltk', but prior to execution of 'nltk.downloader'; this may result in unpredictable behaviour
remote: warn\\(RuntimeWarning\\(msg\\)\\)
remote: \\[nltk_data\\] Downloading package city_database to
remote: \\[nltk_data\\] /tmp/build_.*/.heroku/python/nltk_data...
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
LATEST_PYTHON_3_9 = '3.9.2'
LATEST_PYPY_2_7 = '7.3.2'
LATEST_PYPY_3_6 = '7.3.2'
DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_6
DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_9

# Work around the return value for `default_buildpack` changing after deploy:
# https://github.com/heroku/hatchet/issues/180
Expand Down

0 comments on commit d5459f9

Please sign in to comment.