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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ChristopherMacGown
Copy link

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

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 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 (1cd9204) to head (0b768c1).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1395   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          206       206           
  Lines        14940     14940           
=========================================
  Hits         14940     14940           
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 improve performances by 21.99%

Comparing ChristopherMacGown:support/python3.12 (0b768c1) with master (1cd9204)

Summary

⚡ 4 improvements
✅ 80 untouched benchmarks

Benchmarks breakdown

Benchmark master ChristopherMacGown:support/python3.12 Change
test_min[250] 3.6 ms 3 ms +20.16%
test_first[1000] 4.1 ms 3.3 ms +21.99%
test_get_one[500] 3.1 ms 2.7 ms +13.96%
test_get_or_create_when_get[500] 3.2 ms 2.9 ms +10.04%

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

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