Skip to content

Technical aspects related to Python 2.7 and 3.4 support (pytest 5.0) #5275

Closed
@nicoddemus

Description

@nicoddemus

This issue is to discuss the technical aspects of pytest dropping Python 2 and 3.4 in pytest 5.0 and long term support of the 4.6 series.

For a more user-centric point of view, please see Python 2.7 and 3.4 support plan in the docs.


(This post has since then edited from the original version after the discussion that took place here).

Unless decided otherwise, the last pytest version to support Python 2.7 and 3.4 will be the 4.5 series, which is the last minor release on PyPI.

This issue contains the agreed process on how we will proceed with the pytest 5.0 release and long term support plans for the 4.5 series.

What goes into 4.6.X releases

New 4.6.X releases will contain bug fixes only:

  • A bug will be fixed/ported if, in a normal release, we would merge it in the master branch: often we apply bug fixes to the features branch because even though we are fixing a bug, it may break test suites, so we often take the safest route. Those bugs are often not critical, and won't be ported to the maintenance branch.
  • No new features will be added on this branch, however small.

Who will handle porting bugs

After a PR for a bug fix is merged, and the bug is applicable to the 4.6.X series according to the rules stated previously:

We expect core maintainers who provided the initial bug fix to also create a new PR porting the bug.

From other contributors we expect core maintainers to step up to create a new PR porting the bug if the original contributor is not interested in doing so. @nicoddemus and @asottile applied to be the forefront here, but will gladly accept help from other core maintainers.

When will 4.6.X releases happen

New 4.6.X releases will happen after we have a few bugs in place to release, or if a few weeks have passed (say a single bug has been fixed a month after the latest 4.5.X release). No hard rules here (as with any other pytest release really), just a ballpark.

Backporting changes into the 4.6 release

  1. git fetch --all --prune

  2. git checkout origin/4.6-maintenance -b backport-XXXX # use the PR number here

  3. Locate the merge commit on the PR, in the "merged" message, for example:

    nicoddemus merged commit 0f8b462 into pytest-dev:features

  4. git cherry-pick -m1 REVISION # use the revision you found in 3.

  5. open a PR targeting 4.6-maintenance: prefix the message with [4.6] so it is an obvious backport, delete the PR body (it usually contains a duplicated commit message)

Note for backport PRs a review is not necessary -- though if it it falls into one of these categories a review is strongly suggested:

  • The cherry-pick did not apply cleanly
  • This is a bugfix for only the 4.6.x series

Steps for the first 5.0 release

  1. The absolute first step is to mark features as Python 3 only: ✔️
    • Update setup.py classifiers and python_requires to declare pytest only supports Python 3.5+.
    • Drop Python<3.5 from CI.
    • Update the "Python 2.7 and 3.4 support plan".
  2. After 4.6 is released, we push a pytest4-maintenance branch pointing to 4.6.0 initially. ✔️
  3. The next step is to run pyupgrade --py3-plus (I guess @asottile plans to volunteer here 😉); ✔️
  4. Turn warnings into errors. ✔️
  5. Release 5.0. 🎉

When will we start the 5.0 release process

It is my opinion that we can proceed with the steps above right away, as we are quickly approaching end of May.

If nobody opposes, I plan to start with the first step this week or early next week.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions