Skip to content

Conversation

@ZeroIntensity
Copy link
Owner

@ZeroIntensity ZeroIntensity commented Feb 9, 2025

This eliminates function tables entirely, and instead ships the entire PyAwaitable source code as a header file. This may seem bad at first, but has a lot of nice benefits for us:

  • PyAwaitable is no longer needed as a runtime dependency, as it will be completely baked into an extension.
  • In turn, there's no chance of runtime collisions between installed versions of PyAwaitable.
  • Thus, it's completely safe to pin a PyAwaitable version to an exact number without worrying about compatibility.

On the other hand, there a few downsides:

  • Our ctypes bindings need to be written in favor of a C extension.
  • There is some added complexity with how things are initialized, because a virtual extension has to be created and stored on the interpreter state.
  • We're now completely reliant on a vendoring script, which could prove to be maintenance heavy. (But I doubt it will be worse than capsules.)
  • Debugging will be screwed up a little bit downstream, because function names are mangled.

Closes #30 and #47.

ZeroIntensity and others added 30 commits January 9, 2025 16:15
Also added that generated header to .gitignore.
This is because the older versions are not supported, and also have reached End of Life.
This will be available as a separate include inside of a separate github repository soon. If anyone still needs it they can clone that repository and add it to their include paths.
This will make Visual Studio output less errors when it goes to do it's error checking thing before any builds are performed.
…a weak reference to the module the pyawaitable types get added to. This module object is then in turn internal to the C extension itself.
@ZeroIntensity ZeroIntensity marked this pull request as ready for review February 15, 2025 18:15
@ZeroIntensity ZeroIntensity merged commit 06f7453 into master Feb 16, 2025
26 checks passed
@ZeroIntensity ZeroIntensity deleted the vendor branch February 16, 2025 16:50
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.

Switch to Hatch

3 participants