-
Notifications
You must be signed in to change notification settings - Fork 10
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
Work around various issues with Python 3.12 #222
Conversation
6ce599a
to
46378b5
Compare
46378b5
to
79fa1e4
Compare
8c8f2c5
to
d37aae3
Compare
d37aae3
to
c71fcf2
Compare
@@ -171,6 +171,7 @@ class ResultOrder(enum.Enum): | |||
|
|||
SparseNDCoord = Union[ | |||
None, | |||
Tuple[int, ...], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is necessary that’s fine, I guess, but this should already be covered under ValSliceOrSequence[int]
, since that includes a Sequence[int]
, which is a supertype of Tuple[int, ...]
.
@property | ||
def __orig_bases__(self) -> Any: | ||
# Only exists in Python 3.12 and above | ||
from types import get_original_bases | ||
|
||
return get_original_bases(int) | ||
# return get_original_bases(_T_co) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a typeguard bug—it’s checking too many built-in attributes of the protocol that don’t actually matter. (See, for example, a case where it rejects objects with a completely empty protocol that I found.
That said, if implementing this makes typeguard stop complaining for now, I would do two things:
- Add a comment to that effect, and that it should be removed at some point
- Make this function instead raise
AssertionError
, since it should never be called.
513963b
to
98c2c41
Compare
I believe this PR is no longer necessary; tests+lint have passed on 3.12 in this repo since #186, and single-cell-data/TileDB-SOMA#3001 has 3.12 passing without requiring any somacore changes. |
Awesome, thanks @ryan-williams ! |
TL;DR we are trying to support Python 3.12 in TileDB-SOMA
Solved challenge:
As tracked from parent issue single-cell-data/TileDB-SOMA#1849
main
branch TileDB-SOMA#2734Current unsolved challenges:
typeguard
version is 4.2.0evaluate_forward_ref
within Python's built-intyping
module which broke many packages includingtypeguard
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
typeguard
4.3.0 contains a fix for this problemThe current PR is an attempt to deal with this.
Once this works, we'll need to:
somacore
)somacore
within the TileDB-SOMA repoI've currently got the following setup on an EC2 instance:
somacore
locally withpip install -e
with this PR checked outtiledbsoma
locally withpip install -e
with [python] Python 3.12 support TileDB-SOMA#3001 checked out