pthom / imgui_bundle

Your fast track to powerful GUIs: Dear ImGui Bundle, an extensive toolkit for Python and C++ with immediate mode efficiency.
https://pthom.github.io/imgui_bundle/
MIT License
703 stars 73 forks source link

Pyglet Pure Python Backend doesn't work with python 3.12+ due to distutils removal #249

Closed DragonMoffon closed 1 month ago

DragonMoffon commented 2 months ago

https://github.com/pthom/imgui_bundle/blob/be8339b41ae36e3cd0de372f151ef9590ef44eee/bindings/imgui_bundle/python_backends/pyglet_backend.py#L224-L236

This function still uses the deprecated distutils module's LooseVersion. It appears the recommended fix is to use packaging.version.parse.

https://packaging.pypa.io/en/latest/version.html

pthom commented 2 months ago

I do not have much time to maintain the pyglet backend. I'd be happy to accept a PR, If you have time to investigate more.

If you are able to find a solution that is compatible with all Python compatible version ( 3.10 to 3.12), I'd be happy to accept it.

Thanks for reporting :-)

DragonMoffon commented 1 month ago

So I've looked into how Distutils looseversion works, and it's quite simple. It just converts the version into a list (converting what it can to ints) and then does piecewise comparisons.

I'll make a small PR removing distutils when I can. Do you know any other places distutils might be used? I'll do a full cleanup.

pthom commented 1 month ago

Hello, and thank you for your answer!

I'll make a small PR removing distutils when I can.

Great news

Do you know any other places distutils might be used? I'll do a full cleanup.

I think this is the only place it is used.

eruvanos commented 2 weeks ago

@pthom is it possible to release a patch version with this update?