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

Cython compatibility #517

Merged
merged 1 commit into from
Mar 18, 2022
Merged

Cython compatibility #517

merged 1 commit into from
Mar 18, 2022

Conversation

Borketh
Copy link
Contributor

@Borketh Borketh commented Mar 9, 2022

Summary

This PR is supposed to fix some incompatibilities with Cython and Nextcord.
The first of these is that Cython stores coros internally with the same co_flags as a regular function. Since inspect.iscoroutinefunction is used a bunch in nextcord to ensure listeners work right, "Pure Python" compiled with Cython cannot use nextcord. Cython does add a flag elsewhere that asyncio.iscoroutinefunction does check for (see this). I replaced all calls to inspect's impl with asyncio's impl, altering imports where necessary.

This is a draft for now, because I don't want to merge it until I can make a bot using Cython. Once the first obstacle is fixed, I'm sure there will be more.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

I don't know how to test this yet, I was wondering if you guys would be able to point me in the right direction

@netlify
Copy link

netlify bot commented Mar 9, 2022

✔️ Deploy Preview for nextcord-gh-action ready!

🔨 Explore the source changes: 8b4a3f0

🔍 Inspect the deploy log: https://app.netlify.com/sites/nextcord-gh-action/deploys/62282f6a47e5480007c733c0

😎 Browse the preview: https://deploy-preview-517--nextcord-gh-action.netlify.app

Copy link
Collaborator

@Skelmis Skelmis left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@ooliver1 ooliver1 left a comment

Choose a reason for hiding this comment

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

looks good so far, not approved as you said its untested, @ooliver#6969 in discord when tested though :)

@ooliver1 ooliver1 added t: bug Type: bug - something isn't working s: in progress Status: the issue or PR is in development/progress p: medium Priority: medium - should be worked on in the near future labels Mar 11, 2022
@Borketh Borketh marked this pull request as ready for review March 18, 2022 15:57
@Borketh Borketh requested a review from TAG-Epic as a code owner March 18, 2022 15:57
@ooliver1 ooliver1 merged commit bf90f7a into nextcord:master Mar 18, 2022
@EmmmaTech EmmmaTech removed the s: in progress Status: the issue or PR is in development/progress label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: medium Priority: medium - should be worked on in the near future t: bug Type: bug - something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants