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

3.13 source support (removes deprecated functions) #2994

Merged
merged 1 commit into from
Jul 21, 2024

Conversation

Starbuck5
Copy link
Member

@Starbuck5 Starbuck5 commented Jul 15, 2024

This gets 3.13 building on my system with no warnings, which is an important prereq to getting 3.13 on CI.

It seems like 3.13 on CI should wait for #2945.

Weakref changes: https://docs.python.org/3.13/c-api/weakref.html#c.PyWeakref_GetObject . You can read about in the 3.13 whatsnew.

These changes are really annoying for us, the old behavior was fine for our uses, we could handle the Nones coming out, now we have to deal with 3 separate states (there was no error report state before). The old code was ancient but worked fine. The old function is in the stable ABI, and the new function is new in the release! They are not giving us much of a window here.

So, I had to bring in the python c api compat header to deal with this, the patch would be even more complex if I was trying to make this work on python versions without the new function too. I figure it will be nice for us to have this header around for other features, so we can write our C API code like we only target the latest version.

@Starbuck5 Starbuck5 requested a review from a team as a code owner July 15, 2024 07:54
@Starbuck5 Starbuck5 changed the title 3.13 source support (removes now deprecated function calls) 3.13 source support (removes deprecated functions) Jul 15, 2024
src_c/_pygame.h Outdated Show resolved Hide resolved
src_c/surface.c Outdated Show resolved Hide resolved
src_c/surflock.c Outdated Show resolved Hide resolved
@ankith26
Copy link
Member

Vendoring that header in is definitely a step in the right direction

@Starbuck5
Copy link
Member Author

Vendoring that header in is definitely a step in the right direction

I'm just annoyed the deprecation cycle is so sharp that I feel forced to use it.

src_c/surflock.c Outdated Show resolved Hide resolved
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 👍

Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

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

LGTM! I don't like having to vendor in that header, but I agree it's our best option for now. I do have concerns about maintaining it because we have to re-vendor it every time python gets a minor revision update (and maybe in rare cases where a patch update might break something?). On top of us having to remember to re-vendor it, there's the always-present concern of us supported python revs longer than python itself, so we may still end up having to do our own shimming from time to time if they remove something from the compat header that we still need to support. But, yeah, for now I think this is the best we're gonna get

@Starbuck5
Copy link
Member Author

Starbuck5 commented Jul 21, 2024

I do have concerns about maintaining it because we have to re-vendor it every time python gets a minor revision update.

Well to get new functions from new versions we would need to update this, but new versions won't break old functions.

On top of us having to remember to re-vendor it, there's the always-present concern of us supported python revs longer than python itself, so we may still end up having to do our own shimming from time to time if they remove something from the compat header that we still need to support.

Looking in the header it seems to still support Python 2, so I'm not concerned about that.

@Starbuck5 Starbuck5 added the Code quality/robustness Code quality and resilience to changes label Jul 21, 2024
@Starbuck5 Starbuck5 merged commit 5371e59 into pygame-community:main Jul 21, 2024
38 of 39 checks passed
@Starbuck5 Starbuck5 deleted the 3.13-support branch July 21, 2024 22:52
@Starbuck5 Starbuck5 added this to the 2.5.1 milestone Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants