-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Technical aspects related to Python 2.7 and 3.4 support (pytest 5.0) #5275
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
Comments
Hmmm, if we're not going to go full-py3 on the main branches I don't see much benefit of dropping python2 at all (we'd be still maintaining python2 support but with nothing checking it and extra workflow and process). Yes it's going to be potentially ~slightly more work to backport fixes but that's already going to be the case when refactors due to new features etc. happen. I think we should burn the bridges on |
I'm with @asottile on this one, and would fully exploit Py3 on all the main branches. Basically, I think the time we save backporting will be dwarfed by the productivity gains from feature development, which is after all much more common! Even just reducing the volume of code is a win 😄 |
For the actual release I believe only declaring py3only is the practical way Then the 5 series can gradually sort out the ckeanups. This ensures we can do a 4.x release at any point before 5 and it ensures a time fame of gradually more expensive backports This path is mainly for risk mitigation. I can understand the desire to konmari the codebase asap Let's ensure that process is wrapped so the categories of cleanup happen consistently and spread a bit over time |
it's a snap to just run |
I'm fine with doing that as long as we have a very clear cut line on who pays the backports costs in the core support time frame and ensure they happen in a timely fashion |
@RonnyPfannschmidt's point is the reason why I propose we don't do major changes: we have committed to port bug fixes to the 4.x maintenance branch until the end of the year. This is a commitment that we maintainers have to address. To that end, we will have to:
So this maintenance process will be that much harder if we go "all-in" Python 3, as this will make just cherry-picking a change into the maintenance branch impossible; gradual changes might allow us to cherry-pick and solve an eventual conflict more easily. As @RonnyPfannschmidt mentions, if we go all-in with Python 3, we need a clear commitment from the core maintainers about ensuring the workflow above happens. We can discuss a slight change of plans as well.
|
I do not think cherry-picking will be more complicated - it would e.g. not remove
Maybe we could have branch/PR already to see how this would look like? |
I agree it might not be problematic, but again it might depending on the changes we do. After reading through this, the most important part of this movement IMO is that everyone is on-board with this:
What I would not like to see is bug-fixes not being ported because we made things more difficult by going full Python 3. |
Good idea! 👍 |
here's a demo branch -- I split up the automated / manual steps that I'd take: https://github.com/asottile/pytest/pull/new/pyupgrade_demo I used the following tools:
I'm willing to take up the backport cost, I'd even take up the burden to run all of the backport PRs if it means I can use python3 on the main branch |
🎉 My only possible quibble is that there are a few places where Other things to check: auditing |
'fraid that one's intentional: asottile/pyupgrade#110 (comment) pyupgrade tries really hard to not auto-break your code and so it avoids rewrites that could change behaviour |
I think it is better not touching/changing those unnecessarily, i.e. I'd rather keep them to minimize the diff. But I think it is good in general after a quick review. Would be good to open a PR with it already, to get a coverage report. And https://github.com/pytest-dev/pytest/compare/master...asottile:pyupgrade_demo?expand=1#diff-4ec37b1ad5b7d41fdac56c907d08dde1R441 ( |
If we're going to do python2 / python3 split at all -- there's no reason to minimize the diff. With that attitude we can't take advantage of new features and we can't build new features and we can't refactor as those all maximize the diff. |
Isn't "avoiding merge/cherry-pick conflicts" a good reason? It does not mean to not cause a diff when making use of new features, but using |
to me it sounds like you're saying "don't improve the code because it might cause conflicts", the cost of an automatic vs manual backport is very very small. If we're going to do this at all, I'd like us to fully embrace moving forward without fear, with the understanding that conflicts are a natural part of maintaining a fork |
I kind of agree. Specially after this very encouraging comment:
I also step in here to help with the ports, I don't think we should burden a single person with this. 😁 |
hi, since my deeper involvement is not yet clear, i am delighted to see a reasonable bus factor being set up i understand that there is a natural desire to avoid of the potential of having to shoulder things one didn't commit to oneself (and more back-porting conflicts are certainly one of those things where one really shouldn't have to shoulder other peoples commitments) i believe with both @asottile and @nicoddemus committing to support the backporting efforts it its not unreasonable to go for the better code now option |
So are we in agreement with moving this forward "soon", as we are nearing the end of May already? @blueyed, you were of the opinion that we should not burn bridges at this point, after the discussion that followed do you still feel the same way? |
@nicoddemus So I am +0 on this. |
Sorry, just my way of saying: "we are going full Python 3, even if that means more conflicts when porting bugs to the maintenance branch". Given that IMO we are on the same page, I will update the original post then. |
Hi, updated the original post, please review it and let me know if you disagree with anything. One point that we might go differently than what I wrote: we could make 4.6.0 release with what we have on |
looks good, let's do a 4.6.0 release since it's essentially free for us to do so :) |
No particular objection to a 4.6, but it doesn't look like we have anything worth releasing on |
Ahh right, those are only bug-fixes that we have on |
So I propose we do a |
As discussed in pytest-dev#5275
I've created the Would it be useful to create some labels to better track backporting |
We could also use (a) milestone(s) for tracking backports, but it would not work well with closed PRs/issues then. |
Agree with both 😁 I think we should create a label In fact we can try this right away with #5356. 👍 |
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to pytest-dev#5275
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to pytest-dev#5275
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to pytest-dev#5275
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to pytest-dev#5275
Do we have a good place to document the backporting procedure or is here as good as any? I've found this works the best (for now):
|
I'm going to remove "Requires code review" for the 4.6-maintenance branch -- please use your best judgement for backports (if the patch applies cleanly, probably doesn't need another review) |
How about editing the original post to include those commands?
sgtm 👍 |
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to pytest-dev#5275
Just a (too late) thought: couldn't we have used master instead of 4.6-maintenance, until 4.7 is released? But given the current situation we could just skip features until the next release then, yes? |
yeah too late now |
features is not ahead of master, so let's do this then until 4.7? But also not really / strictly necessary, especially for PRs that might live longer.. so let's rather continue as usual. |
Actually we don't plan to have a 4.7 release at all, only 5.0. 😁 |
the directions no longer work after the move of |
I've updated the text and incorporated the topics from pytest-dev#5275, so this can now be part of the official docs, and pytest-dev#5275 can be closed/unpinned. Closes pytest-dev#5275
I've updated the text and incorporated the topics from pytest-dev#5275, so this can now be part of the official docs, and pytest-dev#5275 can be closed/unpinned. Closes pytest-dev#5275
I've updated the text and incorporated the topics from pytest-dev#5275, so this can now be part of the official docs, and pytest-dev#5275 can be closed/unpinned. Closes pytest-dev#5275
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:
master
branch: often we apply bug fixes to thefeatures
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.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
git fetch --all --prune
git checkout origin/4.6-maintenance -b backport-XXXX
# use the PR number hereLocate the merge commit on the PR, in the "merged" message, for example:
git cherry-pick -m1 REVISION
# use the revision you found in 3.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:
Steps for the first 5.0 release
features
as Python 3 only: ✔️setup.py
classifiers andpython_requires
to declare pytest only supports Python 3.5+.4.6
is released, we push apytest4-maintenance
branch pointing to4.6.0
initially. ✔️pyupgrade --py3-plus
(I guess @asottile plans to volunteer here 😉); ✔️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.
The text was updated successfully, but these errors were encountered: