mozilla-services / python-dockerflow

A Python package to implement tools and helpers for Mozilla Dockerflow
https://python-dockerflow.readthedocs.io
Mozilla Public License 2.0
38 stars 21 forks source link

Limit libraries to versions that only support Python >=3.7, add support for Python 3.11 #76

Closed grahamalama closed 1 year ago

grahamalama commented 1 year ago

In this PR, we:

codecov-commenter commented 1 year ago

Codecov Report

Merging #76 (9631f04) into main (f9da1eb) will decrease coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
- Coverage   97.81%   97.80%   -0.02%     
==========================================
  Files          18       18              
  Lines         596      591       -5     
  Branches       98       85      -13     
==========================================
- Hits          583      578       -5     
  Misses          9        9              
  Partials        4        4              
Files Changed Coverage Δ
src/dockerflow/sanic/app.py 100.00% <ø> (ø)
src/dockerflow/django/middleware.py 100.00% <100.00%> (ø)
src/dockerflow/flask/checks/__init__.py 100.00% <100.00%> (ø)
src/dockerflow/sanic/checks.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

grahamalama commented 1 year ago

@jwhitlock @relud, tagged y'all for review since you seemed to be here last. I'm still working on making changes to documentation, but I figured I'd tag you now to see if there was anything major I needed to fix.

relud commented 1 year ago

why aren't we dropping support for python 3.7 anymore? didn't it hit EoL yesterday?

  • Flask dropped Python 3.6 support in version 2.1.0 (link), so now we only test for compatibility with Flask>=2.1
  • Sanic dropped Python 3.6 support in version 21.3 (link), so now we only test for compatibility with Sanic>=21

This doesn't seem right. As an intermediate library normally I would expect to drop support for a library version in these cases:

so for sanic, version 20.X works up to python 3.9 (which isn't EoL until 2025-10), is one of 3 major versions we support, but per sanic's security policy¹ version 20.12 reached EoL in 2022-12 and that's why we should drop support for sanic<21.12.

¹ https://github.com/sanic-org/sanic/blob/main/SECURITY.md

Sanic releases long term support release once a year in December. LTS releases receive bug and security updates for 24 months.

For flask, there is no EoL policy and version 0.12 works up to at least python 3.10. the 3 latest releases we support are 2.0, 2.1, and 2.2, so it might make sense to drop support for flask<2.0, but I don't see a reason to drop support for 2.0

grahamalama commented 1 year ago

why aren't we dropping support for python 3.7 anymore? didn't it hit EoL yesterday?

@relud I considered this, but I noticed that Django 3.2 (which doesn't hit EoL until April of next year) still supports 3.7.

To your point about 3.7 hitting EoL recently, I figured we could maybe throw in some deprecation warnings (if we want) about dropping support for Python 3.7, then do so in April of next year when Django 3.2 hits its EoL.

For flask, there is no EoL policy and version 0.12 works up to at least python 3.10. the 3 latest releases we support are 2.0, 2.1, and 2.2, so it might make sense to drop support for flask<2.0, but I don't see a reason to drop support for 2.0

Good point -- I'll add Flask 2.0 back 👍🏻