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

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

Merged
merged 17 commits into from Aug 2, 2023

Conversation

grahamalama
Copy link
Contributor

@grahamalama grahamalama commented Jul 31, 2023

In this PR, we:

  • Adjust Flask support to >=2.0,<2.3
  • Adjust Sanic support to >=21,<23
  • Add support for Django 4.2
  • We also added tests to validate support for Python 3.11

@grahamalama grahamalama marked this pull request as draft July 31, 2023 21:39
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2023

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%> (ø)

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

@grahamalama grahamalama changed the title Drop support for Python 3.7, add support for Python 3.11 Limit libraries to versions that only support Python >=3.7, add support for Python 3.11 Aug 1, 2023
@grahamalama grahamalama marked this pull request as ready for review August 1, 2023 16:26
@grahamalama
Copy link
Contributor Author

@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.

docs/changelog.rst Outdated Show resolved Hide resolved
@relud
Copy link
Member

relud commented Aug 1, 2023

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:

  • when library version X reaches EoL
  • when library version X only runs on python<=3.Y and python 3.Y reaches EoL
  • when library version X is more than some number of release versions old (usually 2 or 3)
  • when a library doesn't have an EoL policy, but library's old version X hasn't received a backported security update this library considers critical

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

jwhitlock
jwhitlock previously approved these changes Aug 1, 2023
Copy link
Member

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

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

Thanks @grahamalama! The Django changes look correct. The Sanic and Flask ones look sane as well, however I don't claim to know those frameworks as well, so I'm relying on the passing tests for a 👍.

I think we could add Django 4.2 to the matrix as well, but my local tests show pytest tests/core/ tests/django --nomigrations fails with pytest: error: unrecognized arguments: --nomigrations, so some more special casing will be needed. I'd like to get Django 4.2 into the next release though.

Update: I had an error in tox.ini. If I install -rtests/requirements/django.txt, Django 4.2 is happy as well. I can write a follow-on PR to add Django 4.2.

- Mathieu Leplatre (@leplatrem)
- Les Orchard (@lmorchard)
Copy link
Member

Choose a reason for hiding this comment

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

nit: unneeded change.

src/dockerflow/django/middleware.py Show resolved Hide resolved
src/dockerflow/sanic/checks.py Outdated Show resolved Hide resolved
tests/django/test_django.py Show resolved Hide resolved
tests/flask/test_flask.py Show resolved Hide resolved
tests/requirements/django.txt Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
@grahamalama
Copy link
Contributor Author

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 👍🏻

@grahamalama grahamalama merged commit 3a774d1 into main Aug 2, 2023
10 checks passed
@grahamalama grahamalama deleted the drop-37 branch August 2, 2023 00:18
@@ -0,0 +1 @@
Django>=4.2,<4.3
Copy link
Member

Choose a reason for hiding this comment

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

😍

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.

None yet

4 participants