Skip to content
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

Drop Python 3.6 support #2210

Merged
merged 12 commits into from
Jan 24, 2022
Merged

Drop Python 3.6 support #2210

merged 12 commits into from
Jan 24, 2022

Conversation

agronholm
Copy link
Contributor

This is the (required) first step towards adopting PEP 654 (exception groups).

@codecov
Copy link

codecov bot commented Jan 15, 2022

Codecov Report

Merging #2210 (d2ceef8) into master (4edfd41) will increase coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2210      +/-   ##
==========================================
+ Coverage   99.51%   99.61%   +0.10%     
==========================================
  Files         114      114              
  Lines       14803    14731      -72     
  Branches     2349     2334      -15     
==========================================
- Hits        14731    14675      -56     
+ Misses         47       38       -9     
+ Partials       25       18       -7     
Impacted Files Coverage Δ
trio/_core/_entry_queue.py 100.00% <ø> (ø)
trio/_core/_run.py 100.00% <ø> (ø)
trio/_core/tests/test_guest_mode.py 100.00% <ø> (ø)
trio/_core/tests/test_ki.py 100.00% <ø> (+0.86%) ⬆️
trio/_core/tests/test_run.py 100.00% <ø> (ø)
trio/_highlevel_ssl_helpers.py 100.00% <ø> (+11.76%) ⬆️
trio/_socket.py 100.00% <ø> (ø)
trio/socket.py 100.00% <ø> (ø)
trio/tests/test_threads.py 100.00% <ø> (ø)
trio/_core/_multierror.py 100.00% <100.00%> (+1.08%) ⬆️
... and 6 more

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many other things to remove:

  • the ipython hack in ci.sh
  • the mention of "Python 3.6" in docs/source/reference-io.rst
  • setup.py that still says "3.6-or-better"
  • trio/_core/_entry_queue: we should say dict is always ordered
  • trio/_core/_run.py: remove _count_context_run_tb_frames and CONTEXT_RUN_TB_FRAMES
  • trio/_highlevel_ssl_helpers.py: remove lines that says py36
  • trio/_util.py: remove "and you're using Python 3.6"

There are others, but I stopped at this point.

My strategy for finding those is to grep for 3.6, py36 and "3, 6" and do the same for 3.5 and 3.7, excluding notes-to-self and docs/source/history.rst. I then ask myself: "if written today, would we still mention the version number".

@agronholm
Copy link
Contributor Author

I've updated all the code and comments I could find.

PyPy added support in 7.3.4, the first release with Python 3.7 support
that was not beta.
They always exist in Python 3.7+
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added three more commits, one of them found when searching for "3.7" (in requirements.txt) and the other found by looking at the coverage changes. There are two coverage issues left that I don't know how to fix properly:

  • if hasattr(ssl, "OP_NO_TLSv1_3") is now always True, so we don't test the other configuration as hoped. I don't think there's a good way to use an old OpenSSL version, so we should probably bite the bullet and remove that branch
  • In trio/_util.py, BaseMeta is always ABCMeta in tests, does that mean we can remove the GenericMeta branch? The comment suggests otherwise

See those issues for yourself in https://app.codecov.io/gh/python-trio/trio/compare/2210/changes/. Those two issues seem minor enough that I've approved this PR, but please review my commits before merging.

This flag was introduced in Python 3.7 so it's always there now.
@agronholm
Copy link
Contributor Author

I looked through your changes and they seem fine to me.

@agronholm
Copy link
Contributor Author

Is it customary to squash commits on a merge in this projects? That would be my preference here.

@agronholm agronholm merged commit 39d01b2 into master Jan 24, 2022
@agronholm agronholm deleted the drop-py36 branch January 24, 2022 20:03
@agronholm
Copy link
Contributor Author

Thanks for the review and the assistance!

@pquentin
Copy link
Member

Thank you for working on this! BTW I forgot, but we need a deprecation newsfragment. It can be as simple as https://github.com/python-trio/trio/pull/1481/files#diff-01d318a61ac955b73555728cb95e87911f78ed8cca35f236214f2403c5df81a3

agronholm added a commit that referenced this pull request Jan 25, 2022
agronholm added a commit that referenced this pull request Jan 25, 2022
@pquentin pquentin mentioned this pull request Jan 27, 2022
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