colour-science / flask-compress

Compress responses of your Flask application.
MIT License
117 stars 27 forks source link

Dropping Python 2 Support? #27

Closed gricey432 closed 1 month ago

gricey432 commented 3 years ago

Hey,

I'm just writing up a PR for this repo to propose a new feature. I've used Python 3 language features, however it looks like the package is documented as supporting Python 2. Would you require I submit a Python 2 compatible PR or are you open to matching Flask in supporting only 3.6 and newer?

Cheers

alexprengere commented 3 years ago

Changing the compatibility matrix is a breaking change, so we first need to release a new major version documenting that change, with a clear mention of the new Python versions supported. Ideally we should also modernize the code base (f-strings, annotations, ...). I think Python3.6+ would be a good start (so we effectively drop Python 2.7 and 3.5).

Then we can add Python3-only code. If you do not feel up to it, try to update your code to be "hybrid", supporting both Python2 and Python3 versions (I can help with that if you submit the PR).

kurtmckee commented 1 month ago

Changing the compatibility matrix is a breaking change

Add python_requires=">=3.9" to setup.py, and older versions of Python will not see the new version when resolving and installing dependencies.

Where is the compatibility matrix?

alexprengere commented 1 month ago

About 3 years later, things have changed indeed :wink: On the verge of the 3.13 release, I am fine with dropping pre-3.9 versions. Most packages have already gone there. Flask itself supports Python3.8+ though.

@KelSolaar do you agree with dropping pre-3.9 versions?

kurtmckee commented 1 month ago

I cut 3.8 support in the PR because it's end-of-life at the end of next month (October 31st, 2024).

If changing the cut line to 3.7 and below will speed up consideration of PR #46, I can update the PR very easily.

alexprengere commented 1 month ago

I think your PR is good "as is". I am actually also migrating most of my projects to 3.9+ as well. I will just wait a bit to merge in case anyone begs to differ.

KelSolaar commented 1 month ago

Absolutely fine dropping support for older versions of Python.

alexprengere commented 1 month ago

Great! I will merge the PR, so this issue will be automatically closed.

alexprengere commented 2 weeks ago

For the record release 1.16 shipped with Python3.9+ only support.