Skip to content

Drop support for Python 2.7, 3.4, 3.5 and PyPy#1364

Merged
edmorley merged 1 commit intomainfrom
sunset-eol-pythons
Sep 26, 2022
Merged

Drop support for Python 2.7, 3.4, 3.5 and PyPy#1364
edmorley merged 1 commit intomainfrom
sunset-eol-pythons

Conversation

@edmorley
Copy link
Copy Markdown
Member

@edmorley edmorley commented Sep 22, 2022

Python 2.7, 3.4 and 3.5:

  • are end-of-life upstream, so no longer receiving security updates making them insecure to use
  • have previously been deprecated on the platform, with deprecation warnings
  • have extremely low usage (Python 3.4 and 3.5 combined account for < 0.01% of builds, and Python 2.7 is < 0.3%)
  • are only available on Heroku-18, which itself is deprecated

For PyPy:

  • it was only ever a beta feature, and has been undocumented for some time
  • the versions available on Heroku are outdated and insecure
  • it has extremely low usage (<0.01% of builds)
  • it's already only available on older stacks (Heroku-18 and Heroku-20)
  • in general, only advanced users should be using PyPy as it comes with a number of caveats, and depending on the use-case may not offer enough of a performance improvement (particularly over newer CPython, which has been getting faster) to be worth the trade-offs.

The suggested migration paths are:

  • (For older CPython) Upgrade to a newer Python version by updating runtime.txt or Pipfile + Pipfile.lock.
  • (For PyPy) Switch to CPython by updating runtime.txt to specify python-X.Y.Z instead of pypy*.

Otherwise, users wanting to continue using the above versions can:

  • Pin to an older buildpack release, using the buildpack URL of https://github.com/heroku/heroku-buildpack-python#v218
  • (For PyPy) Switch to the container stack and use the upstream official PyPy Docker image instead.

GUS-W-11796962.
GUS-W-11796984.
GUS-W-11796975.

@edmorley edmorley self-assigned this Sep 22, 2022
@edmorley edmorley marked this pull request as ready for review September 22, 2022 14:23
@edmorley edmorley requested a review from a team as a code owner September 22, 2022 14:23
Python 2.7, 3.4 and 3.5:
- are end-of-life upstream, so no longer receiving security updates
  making them insecure to use
- have previously been deprecated on the platform, with deprecation warnings
- have extremely low usage (Python 3.4 and 3.5 combined account for < 0.01%,
  and Python 2.7 is < 0.3%)
- are only available on Heroku-18, which itself is deprecated

For PyPy:
- it was only ever a beta feature, and has been undocumented for some time
- the versions available on Heroku are outdated and insecure
- it has extremely low usage (<0.01%)
- it's already only available on older stacks (Heroku-18 and Heroku-20)
- in general, only advanced users should be using PyPy as it comes
  with a number of caveats, and depending on the use-case may not offer
  enough of a performance improvement (over newer CPython, which has
  been getting faster) to be worth the trade-offs.

Users wanting to continue using the above versions can:
- Pin to an older buildpack release, using the buildpack URL of
  `https://github.com/heroku/heroku-buildpack-python#v218`
- (For older CPython) Upgrade to a newer Python version by updating their
  `runtime.txt` or `Pipfile` + `Pipfile.lock`.
- (For PyPy) Switch to CPython by updating their `runtime.txt` to use
  `python-X.Y.Z` instead of `pypy*`.
- (For PyPy) Switch to the container stack and use an official upstream
  PyPy Docker image instead.

GUS-W-11796962.
GUS-W-11796984.
GUS-W-11796975.
@edmorley edmorley merged commit 65c9918 into main Sep 26, 2022
@edmorley edmorley deleted the sunset-eol-pythons branch September 26, 2022 08:46
@edmorley
Copy link
Copy Markdown
Member Author

edmorley commented Sep 26, 2022

Added docs to the Python 2.7 EOL FAQ about how to pin to the previous buildpack release, to continue building with Python 2:
https://devcenter.heroku.com/articles/python-2-7-eol-faq#how-do-i-switch-to-a-python-buildpack-version-that-still-supports-python-2

@edmorley
Copy link
Copy Markdown
Member Author

edmorley added a commit that referenced this pull request Apr 18, 2024
For cases where a requested Python version is both (a) EOL, and (b) was
never built for that stack (such as is the case when we add new stacks),
previously the generic "version isn't available for this stack" error
message was shown instead of the more specific EOL Python version error
message.

Now, the EOL version check is performed first before the S3 presence
check, so the more specific EOL message is shown for this case.

In addition to improving the UX, making this change now reduces the
test fixture churn both when we add a new stack and for #1567.

I've also dropped the "PyPy is no longer supported" error message
and associated test, since very few apps ever used it and it's now been
19 months since support was removed in #1364, so it's fine to show the
generic "Python version isn't available" error message for it instead.

GUS-W-15541279.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants