pthom / imgui_bundle

Dear ImGui Bundle: an extensive set of Ready-to-use widgets and libraries, based on ImGui. Start your first app in 5 lines of code, or less. Whether you prefer Python or C++, this pack has your back!
https://pthom.github.io/imgui_bundle/
MIT License
590 stars 62 forks source link

new release #215

Open dcnieho opened 1 month ago

dcnieho commented 1 month ago

Hi Pascal,

I see you are preparing a new release. Would it be possible for you to update to the latest imgui release before doing so, since there is new useful API for shortcuts there? Or are you able to make more frequent releases again?

Just for discussion!

As always, thanks a lot for this great tool, i really enjoy using it :)

pthom commented 1 month ago

Hi Diederick,

Yes, I will emit a new release in the next weeks. I will try to update ImGui in the process.

In the mean time,you can download wheels in the actions on github: https://github.com/pthom/imgui_bundle/actions/workflows/wheels.yml (They are compiled whenever I push new code).

Or are you able to make more frequent releases again?

I am limited by the project size limit on Pypi (10GB max). I did hit the size limit a few months ago (after which I had to remove several older releases). I just took the time to file a project size increase request to Pypi support's team. I hope they will accept it, but it might take a while.

In the meantime, I know that I can only release about 2 or 3 more versions before I hit the limit again. So I have to reduce the frequency

dcnieho commented 1 month ago

Oof, i once had a request with them (for a name, not size), it took the better part of a year. Hope yours goes faster!

It specifically the 1.90.7 support for shortcuts that would be interesting to try out, so that wouldn't be in your wheels yet. I saw also that there is a breaking change in docking/viewports, by the way, hope that doesn't break your stuff

dcnieho commented 3 weeks ago

See also my new posts in issue #80, in case you don't get notified because its closed (I can't reopen)

pthom commented 3 weeks ago

Hi Diederick,

I did update ImGui to v1.90.7. It took me about half a day because I had to update also ImGui Test Engine, and also update the generator options due to new functions being overloaded.

Concerning your other question, see https://github.com/pthom/imgui_bundle/commit/905a805e4394f0bb5ece2c082f576ac0b4c4d659 where I tentatively set the deployment target to 10.14.

Please do test this with your user and keep me informed about the result, I cannot test that on my side; and I can only look at the CI results.

dcnieho commented 3 weeks ago

Thanks for considering dropping the requirement to 10.14. I see the CI fails with the luckily informative message that std::filesystem::path was introduced in 10.15. Mind retrying with 10.15?

Thanks for the trouble!

pthom commented 3 weeks ago

I change it to 1015. Please try it on your side . You can update your clone and push the CI should run on your side also.

dcnieho commented 3 weeks ago

Thanks! That built successfully. I have asked my student to try and install the wheel generated by your action.

dcnieho commented 3 weeks ago

The cp311 wheel installed successfully on the student's platform, but when they try to run imgui_bundle_demo, it errors:

% imgui_bundle_demo 
Traceback (most recent call last): 
  File "/opt/anaconda3/envs/test/bin/imgui_bundle_demo", line 5, in <module>
    from imgui_bundle.demos_python.demo_imgui_bundle import main 
  File "/opt/anaconda3/envs/test/lib/python3.11/site-packages/imgui_bundle/__init__,py", line 2, in <module>
    from imgui_bundle._imgui_bundle import imgui as imgui # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen(/opt/anaconda3/envs/test/lib/python3.11/site-packages/imgui_bundle/_imgui_bundle.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace ' _BrotliDecoderDecompress'

I'm trying with 10.16 on my own fork now, will keep you updated.

dcnieho commented 3 weeks ago

This brotli decoder may not be about the deployment target (may..), also doesn't work on 10.16, same error message. I thought maybe the user doesn't have this brotli available. However, both using pip install brotli and brew install brotli Did not resolve the import error. (Both installed the 1.1.0 version, which is also what the build script picked up according to the log)

I am now trying to use the macos-13 instead of macos-latest runner, lets see...

dcnieho commented 3 weeks ago

Note (also for myself), brotli is pulled in by freetype in hello_imgui. Pulling it in can be disabled, using FT_DISABLE_BROTLI, which is marked as "Disable support of compressed WOFF2 fonts." But this may well not be brotli specific, just the first thing that fails.

dcnieho commented 3 weeks ago

Trying to build on an earlier runner fails:

  + delocate-wheel --require-archs x86_64 -w /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/repaired_wheel -v /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/built_wheel/imgui_bundle-1.5.0-cp311-cp311-macosx_10_15_x86_64.whl
  INFO:delocate.delocating:Copying library /usr/local/Cellar/libpng/1.6.43/lib/libpng16.16.dylib to imgui_bundle/.dylibs/libpng16.16.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/harfbuzz/8.4.0/lib/libharfbuzz.0.dylib to imgui_bundle/.dylibs/libharfbuzz.0.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/brotli/1.1.0/lib/libbrotlidec.1.1.0.dylib to imgui_bundle/.dylibs/libbrotlidec.1.1.0.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/freetype/2.13.2/lib/libfreetype.6.dylib to imgui_bundle/.dylibs/libfreetype.6.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/glib/2.80.2/lib/libglib-2.0.0.dylib to imgui_bundle/.dylibs/libglib-2.0.0.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/gettext/0.22.5/lib/libintl.8.dylib to imgui_bundle/.dylibs/libintl.8.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/graphite2/1.3.14/lib/libgraphite2.3.2.1.dylib to imgui_bundle/.dylibs/libgraphite2.3.2.1.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/pcre2/10.43/lib/libpcre2-8.0.dylib to imgui_bundle/.dylibs/libpcre2-8.0.dylib
  INFO:delocate.delocating:Copying library /usr/local/Cellar/brotli/1.1.0/lib/libbrotlicommon.1.1.0.dylib to imgui_bundle/.dylibs/libbrotlicommon.1.1.0.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libharfbuzz.0.dylib from /usr/local/opt/glib/lib/libglib-2.0.0.dylib to @loader_path/libglib-2.0.0.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/_imgui_bundle.cpython-311-darwin.so from /usr/local/opt/harfbuzz/lib/libharfbuzz.0.dylib to @loader_path/.dylibs/libharfbuzz.0.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libharfbuzz.0.dylib from /usr/local/opt/graphite2/lib/libgraphite2.3.dylib to @loader_path/libgraphite2.3.2.1.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/_imgui_bundle.cpython-311-darwin.so from /usr/local/opt/libpng/lib/libpng16.16.dylib to @loader_path/.dylibs/libpng16.16.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libfreetype.6.dylib from /usr/local/opt/libpng/lib/libpng16.16.dylib to @loader_path/libpng16.16.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/_imgui_bundle.cpython-311-darwin.so from @rpath/libglfw.3.dylib to @loader_path/libglfw.3.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libharfbuzz.0.dylib from /usr/local/opt/gettext/lib/libintl.8.dylib to @loader_path/libintl.8.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libglib-2.0.0.dylib from /usr/local/opt/gettext/lib/libintl.8.dylib to @loader_path/libintl.8.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libbrotlidec.1.1.0.dylib from /usr/local/Cellar/brotli/1.1.0/lib/libbrotlicommon.1.dylib to @loader_path/libbrotlicommon.1.1.0.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libharfbuzz.0.dylib from /usr/local/opt/freetype/lib/libfreetype.6.dylib to @loader_path/libfreetype.6.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/.dylibs/libglib-2.0.0.dylib from /usr/local/opt/pcre2/lib/libpcre2-8.0.dylib to @loader_path/libpcre2-8.0.dylib
  INFO:delocate.delocating:Modifying install name in imgui_bundle/_imgui_bundle.cpython-311-darwin.so from /usr/local/opt/brotli/lib/libbrotlidec.1.dylib to @loader_path/.dylibs/libbrotlidec.1.1.0.dylib
  Fixing: /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/built_wheel/imgui_bundle-1.5.0-cp311-cp311-macosx_10_15_x86_64.whl
  Traceback (most recent call last):
    File "/private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/build/venv/bin/delocate-wheel", line 8, in <module>
      sys.exit(main())
               ^^^^^^
    File "/private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/build/venv/lib/python3.11/site-packages/delocate/cmd/delocate_wheel.py", line 110, in main
      copied = delocate_wheel(
               ^^^^^^^^^^^^^^^
    File "/private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/build/venv/lib/python3.11/site-packages/delocate/delocating.py", line 1004, in delocate_wheel
      out_wheel_fixed = _check_and_update_wheel_name(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/cibw-run-etc8ssvh/cp311-macosx_x86_64/build/venv/lib/python3.11/site-packages/delocate/delocating.py", line 839, in _check_and_update_wheel_name
      raise DelocationError(
  delocate.libsana.DelocationError: Library dependencies do not satisfy target MacOS version 10.15:
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libpcre2-8.0.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libgraphite2.3.2.1.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libintl.8.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libglib-2.0.0.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libpng16.16.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libbrotlicommon.1.1.0.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libbrotlidec.1.1.0.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libfreetype.6.dylib has a minimum target of 13.0
  /private/var/folders/vy/h7r6h43j203gstfh6fj9_tyh0000gn/T/tmp1s2vh1j3/wheel/imgui_bundle/.dylibs/libharfbuzz.0.dylib has a minimum target of 13.0

So i guess that means were stuck unless one would build all these libraries yourself. The cibuildwheel docs say: Since delocate 0.11.0 there is added verification that the library binary dependencies match the target macOS version. This is to prevent the situation where a wheel platform tag is lower than the actual minimum macOS version required by the library. To resolve this error you need to build the library to the same macOS version as the target wheel (for example using MACOSX_DEPLOYMENT_TARGET environment variable). Alternatively, you could set MACOSX_DEPLOYMENT_TARGET in CIBW_ENVIRONMENT to correctly label the wheel as incompatible with older macOS versions.

This error may happen when you install a library using a package manager like Homebrew, which compiles the library for the macOS version of the build machine. This is not suitable for wheels, as the library will only work on the same macOS version as the build machine. You should compile the library yourself, or use a precompiled binary that matches the target macOS version.

dcnieho commented 3 weeks ago

The strange thing perhaps is that the user is on 13.4, but the compatible targets declared by python go no higher than 10.16.

dcnieho commented 3 weeks ago

Ok, this seems to be a bug in pip/packaging. See for instance here: https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4359, or here: https://github.com/microsoft/onnxruntime/issues/19371#issuecomment-1924720936 So the solutions are to have a new enough pip (and thereby a new enough packaging package, >=22.0), or to set the SYSTEM_VERSION_COMPAT=0 environment flag when trying to install imgui_bundle.

I have asked my user to check.

pthom commented 3 weeks ago

AFAIK, OS updates are free on Mac. Is there a compelling reason why those students cannot update their version of macOS?

dcnieho commented 3 weeks ago

I hear from MacOS users that upgrades are likely to bring new problems and compatibility issues as much as new features. So they ten to upgrade once a year, if even that (don't change a working setup). But yeah, users shouldn't need to be forced to update MacOS to be able to install imgui_bundle. If this turns out to be running into a pip/packaging bug, then I guess the solution is a small addition to the docs. Will let you know/send pull request.

dcnieho commented 3 weeks ago

Reading pip changelogs, i see that the fixed version of the packaging package still isn't vendored by latest pip, so that did nothing.

But asking the user to run SYSTEM_VERSION_COMPAT=0 pip install --only-binary=:all: imgui_bundle got stuff installed, and it ran! I'll send you a pull request with a doc update, if i find a nice place (and to revert the target version stuff in the build scripts)

Thanks for going down this road with me!

pthom commented 3 weeks ago

Thanks for going down this road with me!

You're welcome. I just merged you PR. Thanks a lot

dcnieho commented 3 weeks ago

Most welcome, glad we figured this out!