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

Pymunk import #2458

Draft
wants to merge 7 commits into
base: development
Choose a base branch
from
Draft

Pymunk import #2458

wants to merge 7 commits into from

Conversation

eruvanos
Copy link
Member

@eruvanos eruvanos commented Nov 18, 2024

Fix for: #2454

This PR makes pymunk import optional and just prints the following during start.

Warning: pymunk is not installed. PymunkHitBoxAlgorithm will not be available.
Pymunk is not installed. Pymunk physics engine will not be available.

@DragonMoffon
Copy link
Collaborator

So this looks good, but there are a few other places that reference pymunk, and because the pymunk objects may not be available, type hints and code completion might get a little confused.

I don't think the code i wrote is particularly good, but i do have a branch where i also tried this you could compare with.

@DragonMoffon
Copy link
Collaborator

I think the first step to doing this properly is to actually quarantine all pymunk objects to a pymunk submodule and then create a 'NotImported' object that raises an import error in 'getattr', 'call' etc.

@eruvanos eruvanos marked this pull request as draft November 19, 2024 12:37
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.

2 participants