From 6bdb6087bee28882a59b77f4f8d9d6dd2323cc0d Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 14 Feb 2023 07:46:51 +0000 Subject: [PATCH] Use Python 3.11 as the default Python version for new apps Previously if a new app did not specify a Python version via a `runtime.txt` file or the appropriate `Pipfile` config option, then the buildpack would default to the latest Python 3.10 release (currently Python 3.10.10). Now the buildpack will use the latest Python 3.11 release (currently Python 3.11.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.11 will now need to specify Python 3.10 explicitly: https://devcenter.heroku.com/articles/python-support#specifying-a-python-version However most apps should be compatible, since Python 3.11 was released several months ago (2022-10-24), does not contain significant breaking changes over Python 3.10, and has been happily used by the python-getting-started project since 2022-10-25. GUS-W-12345720. --- CHANGELOG.md | 1 + README.md | 2 +- bin/default_pythons | 2 +- spec/hatchet/nltk_spec.rb | 1 - spec/hatchet/stack_spec.rb | 8 ++++---- spec/spec_helper.rb | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9023ecf17..52d61ee33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Use Python 3.11 as the default Python version for new apps (previously Python 3.10) ([#1408](https://github.com/heroku/heroku-buildpack-python/pull/1408)). ## v225 (2023-02-08) diff --git a/README.md b/README.md index 866990ae1..7074f808b 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.10.10 +Current default Python Runtime: Python 3.11.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`. diff --git a/bin/default_pythons b/bin/default_pythons index 7b94586a0..f69e55eda 100755 --- a/bin/default_pythons +++ b/bin/default_pythons @@ -15,4 +15,4 @@ LATEST_36="python-3.6.15" LATEST_35="python-3.5.10" LATEST_34="python-3.4.10" LATEST_27="python-2.7.18" -DEFAULT_PYTHON_VERSION="${LATEST_310}" +DEFAULT_PYTHON_VERSION="${LATEST_311}" diff --git a/spec/hatchet/nltk_spec.rb b/spec/hatchet/nltk_spec.rb index f5ed8922e..bc9789dbb 100644 --- a/spec/hatchet/nltk_spec.rb +++ b/spec/hatchet/nltk_spec.rb @@ -12,7 +12,6 @@ remote: -----> Downloading NLTK corpora… remote: -----> Downloading NLTK packages: city_database stopwords 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... remote: \\[nltk_data\\] Unzipping corpora/city_database.zip. diff --git a/spec/hatchet/stack_spec.rb b/spec/hatchet/stack_spec.rb index bfbbf1521..cc1965e59 100644 --- a/spec/hatchet/stack_spec.rb +++ b/spec/hatchet/stack_spec.rb @@ -56,10 +56,10 @@ remote: -----> No Python version was specified. Using the same version as the last build: python-#{DEFAULT_PYTHON_VERSION} remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by python) - remote: python: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by /app/.heroku/python/lib/libpython3.10.so.1.0) - remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /app/.heroku/python/lib/libpython3.10.so.1.0) - remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/.heroku/python/lib/libpython3.10.so.1.0) - remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /app/.heroku/python/lib/libpython3.10.so.1.0) + remote: python: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by /app/.heroku/python/lib/libpython3.11.so.1.0) + remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /app/.heroku/python/lib/libpython3.11.so.1.0) + remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/.heroku/python/lib/libpython3.11.so.1.0) + remote: python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /app/.heroku/python/lib/libpython3.11.so.1.0) remote: -----> Stack has changed from heroku-22 to heroku-20, clearing cache remote: -----> No change in requirements detected, installing from cache remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7419a41e8..4ba810952 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,7 +12,7 @@ LATEST_PYTHON_3_9 = '3.9.16' LATEST_PYTHON_3_10 = '3.10.10' LATEST_PYTHON_3_11 = '3.11.2' -DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_10 +DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_11 # Work around the return value for `default_buildpack` changing after deploy: # https://github.com/heroku/hatchet/issues/180