singingwolfboy / flask-dance

Doing the OAuth dance with style using Flask, requests, and oauthlib.
https://pypi.python.org/pypi/Flask-Dance/
MIT License
1.01k stars 158 forks source link

Drop EoLed Python versions (including python 2) #340

Closed rooterkyberian closed 3 years ago

rooterkyberian commented 3 years ago

All python versions older than 3.6 are long dead. https://endoflife.date/python

Motivation for removing them is quite simple - its just easier to support less python versions and python 3.x line has introduced number of nice features that we can start leveraging (fstrings, type hints among others). You can already see some improvements done by pyupgrade in this PR.

Please note just removing them here, thanks to pip support for python_requires will not break old installations assuming they have a setuptools>=24.2.0 and pip>=9.0.0 .

1) document the python versions supported in setup.py 2) update tox, github actions config 3) run pyupgrade --py36-plus 4) remove six package

codecov[bot] commented 3 years ago

Codecov Report

Merging #340 (c5a2c3b) into main (5a17754) will decrease coverage by 0.31%. The diff coverage is 95.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
- Coverage   93.80%   93.49%   -0.32%     
==========================================
  Files          33       33              
  Lines        1066     1015      -51     
==========================================
- Hits         1000      949      -51     
  Misses         66       66              
Impacted Files Coverage Δ
flask_dance/__init__.py 100.00% <ø> (ø)
flask_dance/consumer/oauth1.py 68.60% <ø> (-0.37%) :arrow_down:
flask_dance/fixtures/pytest.py 91.66% <ø> (-0.34%) :arrow_down:
flask_dance/contrib/strava.py 95.45% <66.66%> (-0.38%) :arrow_down:
flask_dance/contrib/reddit.py 96.29% <75.00%> (-0.26%) :arrow_down:
flask_dance/consumer/base.py 90.00% <100.00%> (-0.25%) :arrow_down:
flask_dance/consumer/oauth2.py 92.23% <100.00%> (-0.08%) :arrow_down:
flask_dance/consumer/requests.py 100.00% <100.00%> (ø)
flask_dance/consumer/storage/__init__.py 70.37% <100.00%> (-1.06%) :arrow_down:
flask_dance/consumer/storage/sqla.py 93.57% <100.00%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5a17754...c5a2c3b. Read the comment docs.

daenney commented 3 years ago

I'm generally fine with this and I agree it makes some stuff easier. I'd like to get the Dropbox one landed and tagged with Python 2 support still in there though. After that we can proceed with this PR and tag a new major version of the library.

@singingwolfboy Do you have any other big things you'd like to do? I don't feel we can drop Python 2 support in a minor release, so now would be an opportunity to do any other changes that might not be backwards compatible.

singingwolfboy commented 3 years ago

I just released v3.3.0, and I think we can make this change for Flask-Dance v4.0.0. This PR is already pretty comprehensive; the only thing I can think of off the top of my head is simplifying all the places where we do this:

try:
    from flask import _app_ctx_stack as stack
except ImportError:
    from flask import _request_ctx_stack as stack

We should be able to just do from flask import _app_ctx_stack -- the except ImportError block is only relevant for very, very old versions of Flask that might not even run on Python 3.

rooterkyberian commented 3 years ago

rebased to current main, removed old flask import

@singingwolfboy is anything else needed here?

rooterkyberian commented 3 years ago

anything else?

singingwolfboy commented 3 years ago

Thanks so much! Just merged it 🎉