-
Notifications
You must be signed in to change notification settings - Fork 25
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
[python] Python 3.12 support #3001
base: main
Are you sure you want to change the base?
Conversation
dc19af6
to
f1a3909
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3001 +/- ##
==========================================
+ Coverage 83.54% 83.65% +0.11%
==========================================
Files 51 51
Lines 5434 5434
==========================================
+ Hits 4540 4546 +6
+ Misses 894 888 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
9616847
to
f1a3909
Compare
beed527
to
a96c72d
Compare
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.
right now leaving comments as I go through each commit. apologies if this is already resolved in a later one
git clone [email protected]:single-cell-data/SOMA.git soma | ||
cd ./SOMA | ||
git checkout kerl/python-3.12 | ||
pip install ./ | ||
python -c 'import somacore; print(somacore.__version__)' |
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.
pip install git+https://github.com/single-cell-data/SOMA.git@kerl/python-3.12
might be able to replace this with a one-liner that leaves your venv in a better state?
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.
@thetorpedodog thanks! This stanza was my copy-paste of another time someone wanted to run tiledbsoma CI against a non-merged somacore mod ... I'll save off your advice in my cheat-sheet for next time -- thank you!
From the build log:
This is because at the point this line is executed, the symbol
needs to be moved above all the imports. (Alternately, it might make sense to create a |
@thetorpedodog thank you!!! I got some 'new style lint' here -- I don't know why, I didn't change any linter versions -- and was forced to move imports :( There's something weird to debug here -- I'll see if I can make everything in the CI toolchain happy simultaneously -- thank you!!! Also I'll try the |
8ff4ec3
to
f3674a9
Compare
And re
I have traced that to here: https://github.com/single-cell-data/TileDB-SOMA/pull/3004/files#r1763424424 |
9790ab0
to
db17d38
Compare
Hi guys, thanks for your amazing package. I understand this is in flux as we write - as a power user I would kindly like to ask if there's anything I can do to help push this through - I really need it and workarounds are a decent pain. (As I understand, now there is a buggy typechecker stalling CI stalling 3.12 adoption, which itself was released 12 months ago. If inaccurate feel free to correct) |
@iosonofabio thank you! Your assessment is correct -- current status is here: #1849 (comment) and @ryan-williams will be moving this forward |
db17d38
to
6fdbd75
Compare
63b6d5e
to
8c5f857
Compare
I can't add you as a reviewer since you opened this PR, @johnkerl, but I would like your review on the latest changes that I've pushed here 🙏 Depending on typeguard@HEAD may trip up SOMA developers who have existing typeguard 4.2.1 or 4.3.0 installations, but I'm not sure what the other option is. As soon as agronholm/typeguard#490 makes it into a release, we can move to that. Could also try to only depend on typeguard@HEAD in Python 3.12, but I thought that was more complex than it was worth. |
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.
LGTM!! :)
@@ -783,7 +783,9 @@ def make_multiply_indexed_dataframe( | |||
"domain": [[-1000, 1000]], | |||
"coords": [{"bogus": True}], | |||
"A": None, | |||
"throws": TypeError, | |||
# Disable Typeguard while asserting this error, otherwise a typeguard.TypeCheckError is |
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.
Let's hvae a GitHub issue tracking the 'real' typeguard release, and let's put its URL here as a to-do comment
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 change isn't due to using Typeguard@HEAD; it will remain relevant when we move back to a proper Typeguard release.
The reason for it is: in 3.12, better type-checking was causing a TypeCheckError
to occur before the TypeError
we were verifying here.
I worked around it by disabling type-checking while triggering this error, so we can continue to verify what we were previously.
throws = io.get("throws", None) | ||
if throws: | ||
if isinstance(throws, tuple) and not throws[1]: | ||
# Disable Typeguard, verify actual runtime error type (avoid |
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.
Ditto the above to-do URL/comment
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.
Same as above, todo related to upgrading Typeguard is not applicable here.
Agreed. And it only affects folks on 3.12, so any dev who really wants to avoid this can use 3.11. |
@@ -783,7 +783,9 @@ def make_multiply_indexed_dataframe( | |||
"domain": [[-1000, 1000]], | |||
"coords": [{"bogus": True}], | |||
"A": None, | |||
"throws": TypeError, | |||
# Disable Typeguard while asserting this error, otherwise a typeguard.TypeCheckError is |
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 change isn't due to using Typeguard@HEAD; it will remain relevant when we move back to a proper Typeguard release.
The reason for it is: in 3.12, better type-checking was causing a TypeCheckError
to occur before the TypeError
we were verifying here.
I worked around it by disabling type-checking while triggering this error, so we can continue to verify what we were previously.
throws = io.get("throws", None) | ||
if throws: | ||
if isinstance(throws, tuple) and not throws[1]: | ||
# Disable Typeguard, verify actual runtime error type (avoid |
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.
Same as above, todo related to upgrading Typeguard is not applicable here.
typeguard==4.2.1 | ||
# Python 3.12 support requires https://github.com/agronholm/typeguard/pull/490. | ||
# Use Typeguard @ HEAD until that PR is included in a release. | ||
typeguard @ git+https://github.com/agronholm/typeguard |
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 would be the place for a TODO / issue link related to upgrading Typeguard. Do you want me to change this comment?
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.
Filed #3216 and referenced it here
8c5f857
to
b7db9ed
Compare
For issue #1849 -- which has a long history.
See also #2999 and [sc-53002].
This needs single-cell-data/SOMA#222