Skip to content

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
@eruvanos
Copy link
Member Author

@DragonMoffon is right, so we drop this PR

@eruvanos eruvanos closed this Mar 27, 2025
@eruvanos eruvanos deleted the pymunk-import branch March 29, 2025 07:21
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.

3 participants