pyinstaller / pyinstaller-hooks-contrib

Community maintained hooks for PyInstaller.
Other
96 stars 126 forks source link

Add hook for sv_ttk #826

Closed aarons20 closed 3 weeks ago

aarons20 commented 4 weeks ago

This hook ensures that tcl files are collected during the building process.

rokm commented 4 weeks ago

Hmm, looks like the tkinter is (still) broken in earlier python builds for x86_64 macOS. Can you add a decorator like this to the test to make sure it is skipped if tkinter is not importable?

https://github.com/pyinstaller/pyinstaller/blob/0779daae400daa4066f91dd634cc731608b901ed/tests/functional/test_hooks/test_pil.py#L27

aarons20 commented 4 weeks ago

Hmm, looks like the tkinter is (still) broken in earlier python builds for x86_64 macOS. Can you add a decorator like this to the test to make sure it is skipped if tkinter is not importable?

https://github.com/pyinstaller/pyinstaller/blob/0779daae400daa4066f91dd634cc731608b901ed/tests/functional/test_hooks/test_pil.py#L27

Thank you for the hint. I already tried to modify the CI to install tkinter for macOS 13 or something :)

rokm commented 4 weeks ago

Looks like the extra decorator did not help - I'll take a closer look tomorrow to see what exactly is going on.

aarons20 commented 4 weeks ago

Hmm, looks like the tkinter is (still) broken in earlier python builds for x86_64 macOS. Can you add a decorator like this to the test to make sure it is skipped if tkinter is not importable? https://github.com/pyinstaller/pyinstaller/blob/0779daae400daa4066f91dd634cc731608b901ed/tests/functional/test_hooks/test_pil.py#L27

Thank you for the hint. I already tried to modify the CI to install tkinter for macOS 13 or something :)

Seems still to not work. I've read something about a potential tk version mismatch (8.5 vs 8.6). Perhaps that is why the decorator does not help?

aarons20 commented 4 weeks ago

Looks like the extra decorator did not help - I'll take a closer look tomorrow to see what exactly is going on.

Thank you. Have a good night!

rokm commented 4 weeks ago

Aha, I knew that I have previously worked around this tk.h version (8.5) doesn't match libtk.a version (8.6) issue in some test in the main repository...

The problem is that this error is not raised on tkinter import, but rather when window is created (which in the case of your test happens when set_theme is called). So instead of decorator based on can_import_module("tkinter"), we will need this:

https://github.com/pyinstaller/pyinstaller/blob/0779daae400daa4066f91dd634cc731608b901ed/tests/functional/test_libraries.py#L55-L81

aarons20 commented 4 weeks ago

Aha, I knew that I have previously worked around this tk.h version (8.5) doesn't match libtk.a version (8.6) issue in some test in the main repository...

The problem is that this error is not raised on tkinter import, but rather when window is created (which in the case of your test happens when set_theme is called). So instead of decorator based on can_import_module("tkinter"), we will need this:

https://github.com/pyinstaller/pyinstaller/blob/0779daae400daa4066f91dd634cc731608b901ed/tests/functional/test_libraries.py#L55-L81

So since this function is in an other repository I will just copy the snippet and change the decorator?

rokm commented 3 weeks ago

Thank you!