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

✨ Add support for Python 3.12 #10666

Merged
merged 3 commits into from Jan 10, 2024
Merged

Conversation

Jamim
Copy link
Contributor

@Jamim Jamim commented Nov 17, 2023

Hello @tiangolo,

Thank you for this awesome framework! πŸ™‡πŸ»β€β™‚οΈ

I believe that it would be great to have an explicit Python 3.12 support, so I'd like to suggest changes that:

  • enable testing for Python 3.12 on CI
  • update classifiers at pyproject.toml
  • fix deprecation warning for tutorials

Best regards!

@tiangolo
Copy link
Owner

πŸ“ Docs preview for commit 6a803e9 at: https://fdeed641.fastapitiangolo.pages.dev

@tiangolo
Copy link
Owner

πŸ“ Docs preview for commit 9cf9b37 at: https://b363ac74.fastapitiangolo.pages.dev

Copy link
Contributor

@yezz123 yezz123 left a comment

Choose a reason for hiding this comment

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

Amazing PR! We should have this ASAP In FastAPI πŸš€

@tiangolo
Copy link
Owner

πŸ“ Docs preview for commit 4706a5a at: https://349a3a21.fastapitiangolo.pages.dev

@tiangolo
Copy link
Owner

tiangolo commented Dec 2, 2023

πŸ“ Docs preview for commit 726ad48 at: https://a5709203.fastapitiangolo.pages.dev

@tiangolo
Copy link
Owner

tiangolo commented Dec 5, 2023

πŸ“ Docs preview for commit 942720f at: https://29aa7fca.fastapitiangolo.pages.dev

@tiangolo
Copy link
Owner

πŸ“ Docs preview for commit bdfb1e6 at: https://3b25437a.fastapitiangolo.pages.dev

Copy link

@kiendang kiendang left a comment

Choose a reason for hiding this comment

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

My 2 cents: looks like FastAPI does not use utcnow in its library code (only in docs_src/security, not fastapi) so it should not provide a compat function for it. The fix should be in the tutorials, not fastapi/_compat.py

These changes:
  * enable testing for Python 3.12 on CI
  * update classifiers at pyproject.toml
  * fix deprecation warning for tutorials
@tiangolo
Copy link
Owner

πŸ“ Docs preview for commit db118d7 at: https://4c865de2.fastapitiangolo.pages.dev

@Jamim
Copy link
Contributor Author

Jamim commented Dec 27, 2023

Thank you for the review, @kiendang! πŸ™‡πŸ»β€β™‚οΈ

I've came to a conclusion that you are completely right, so I've updated the PR to get rid of an unnecessary compatibility function. Even better, I've realized there is a universal solution with datetime.now(timezone.utc) that works for all supported Python versions.

@Jamim Jamim requested a review from kiendang December 27, 2023 03:02
Copy link

@kiendang kiendang left a comment

Choose a reason for hiding this comment

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

πŸ™Œ Hopefully this got merged soon.

@Kludex
Copy link
Sponsor Collaborator

Kludex commented Dec 27, 2023

@tiangolo When you merge this, close the others:

@Jamim
Copy link
Contributor Author

Jamim commented Dec 31, 2023

Hello @tiangolo,

Sorry for bothering you, but it would be really great if you find a few minutes for this PR.
It has already been refined based on community feedback and has received 3 approvals.

Thanks in advance and Happy New Year! πŸŽ„

@alejsdev alejsdev changed the title Add support for Python 3.12 ✨ Add support for Python 3.12 Jan 8, 2024
@alejsdev alejsdev added the feature New feature or request label Jan 8, 2024
@tiangolo
Copy link
Owner

tiangolo commented Jan 9, 2024

Nice, thank you @Jamim! πŸš€ 🍰

And thanks for the reviews @kiendang, @yezz123, @lsglucas, @alejsdev πŸ™‡

@tiangolo
Copy link
Owner

tiangolo commented Jan 9, 2024

πŸ“ Docs preview for commit 034ded2 at: https://56304ca1.fastapitiangolo.pages.dev

@alejsdev alejsdev merged commit 07f8d31 into tiangolo:master Jan 10, 2024
38 checks passed
@Jamim Jamim deleted the feature/python-3.12 branch January 10, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants