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

Support python 3.12 #1395

Merged
merged 6 commits into from
Dec 5, 2024
Merged

Conversation

ChristopherMacGown
Copy link
Contributor

  • typing: remove types-pkg-resources package
  • fix: recursive_guard is a KW_ONLY arg in 3.12.4+

@ChristopherMacGown ChristopherMacGown changed the title support/python3.12 Support python 3.12 Sep 18, 2024
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4e656d9) to head (cabee1f).
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1395   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          207       207           
  Lines        14942     14942           
=========================================
  Hits         14942     14942           
Files with missing lines Coverage Δ
ormar/fields/foreign_key.py 100.00% <ø> (ø)

Copy link

codspeed-hq bot commented Sep 19, 2024

CodSpeed Performance Report

Merging #1395 will degrade performances by 23.78%

Comparing ChristopherMacGown:support/python3.12 (cabee1f) with master (4e656d9)

Summary

⚡ 2 improvements
❌ 1 (👁 1) regressions
✅ 81 untouched benchmarks

Benchmarks breakdown

Benchmark master ChristopherMacGown:support/python3.12 Change
👁 test_first[250] 2.7 ms 3.5 ms -23.78%
test_get_or_none[250] 3.6 ms 2.8 ms +29%
test_values_list[250] 8 ms 7.1 ms +12.02%

@@ -55,6 +55,7 @@ asyncpg = { version = ">=0.28,<0.30", optional = true }
psycopg2-binary = { version = "^2.9.1", optional = true }
mysqlclient = { version = "^2.1.0", optional = true }
PyMySQL = { version = "^1.1.0", optional = true }
setuptools = "^75.1.0"
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CodeFactor failed the prior commit due to GHSA-cx63-2mw6-8hw5

@collerek
Copy link
Owner

Please also add 3.12 to the test matrix in

python-version: [3.8, 3.9, "3.10", 3.11]

@ChristopherMacGown
Copy link
Contributor Author

Regarding the failed test, distutils was deprecated in Python 3.10 and removed in Python 3.12. The test job pins poetry to 1.4.2, but the first version of poetry that supports 3.12 is 1.7.0. I would bump the poetry version in the PR, but I noticed that the version is pinned to different versions in different workflows and that don't want to bump them all without a discussion.

@collerek
Copy link
Owner

Regarding the failed test, distutils was deprecated in Python 3.10 and removed in Python 3.12. The test job pins poetry to 1.4.2, but the first version of poetry that supports 3.12 is 1.7.0. I would bump the poetry version in the PR, but I noticed that the version is pinned to different versions in different workflows and that don't want to bump them all without a discussion.

I guess we can bump it and unify the version, note that you will have to relock the file with new version probably.

@ChristopherMacGown
Copy link
Contributor Author

ChristopherMacGown commented Oct 23, 2024

I added Python 3.13 to the test matrix to try and get coverage there but it looks like there aren't ryu wheels for it yet. The uvloop dependency was broken on python 3.13 until version 0.21.0 I'll push up a commit removing it soon

The package has been yanked on pypi as it has been superceded by
types-setuptools. However, setuptools now provides type-hints for the
pkg-resources package, so it is no longer needed. Additionally, it does
not appear to be used in the project at all, so it appears vestigial.
Python 3.9 added recursive_guard to ForwardRef._evaluate to prevent
infinite recursion of recursive types. This is a private method, and no
API contract is provided. So, when the API changed in the 3.12.4 release
they did not bother to document it, or highlight that it is a breaking
release.
Versions of setuptools prior to 70.0.0 were vulnerable to a remote
execution exploit documented in CVE-2024-6345-setuptools.
@ChristopherMacGown
Copy link
Contributor Author

The CodeFactor report is about a vulnerability in multipart/form-data in starlette versions prior to 0.40.0. In order to clear that report and update starlette, the fastapi pin will need to be relaxed to allow 0.115.3 to be installed, currently it is pinned to versions below 0.112.0.

Copy link
Owner

@collerek collerek left a comment

Choose a reason for hiding this comment

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

Awesome, thanks a lot! :)

@collerek collerek merged commit 0014c46 into collerek:master Dec 5, 2024
17 checks passed
@collerek collerek mentioned this pull request Dec 6, 2024
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.

2 participants