Pyinstaller branch rebase and fbs removal#238
Conversation
fbs was holding back the code from using modern versions of python, qt, and everything else. Remove fsb and update everything. * Remove fbs from spec * update to python 3.12 * update all dependencies to latest minor releases * update to latest version of pyinstaller * re-implement part of fbs context object to minimize refactoring * update Vial.spec to have all options necessary to run
721338d to
0794bcc
Compare
0794bcc to
9d4067d
Compare
|
Anecdotally, this seems to work on Linux for me. The Vial window opens, I can change key mappings on the keyboard, unlock the keyboard and run the matrix tester, save/load the keyboard layout. |
|
I am still having issues with vial recognizing my via-configured keyboard, so I haven't even been able to test beyond "software builds and runs". |
|
I managed to build this on a Mac but seems like it keeps opening new windows for some reason. |
|
I had the same problem of application endlessly spawning new instances. This seems to be fixed by adding call to multiprocessing.freeze_support() to main.py |
|
Huh, I had no idea this package used multiprocessing, but there it is: Would you mind sending a patch for where this goes? |
|
|
This is what I needed to get vial running on my m1 mac: diff --git a/requirements.txt b/requirements.txt
index faa0f9d..5c2bb54 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,9 +8,9 @@ packaging==24.0
pefile==2023.2.7
pyinstaller==6.5.0
pyinstaller-hooks-contrib==2024.3
-PyQt5==5.15.7
-PyQt5-Qt5==5.15.2
-PyQt5-sip==12.13.0
+PyQt5==5.15.11
+PyQt5-Qt5==5.15.11
+PyQt5-sip==12.15.0
pywin32==306; sys_platform == 'win32'
pywin32-ctypes==0.2.2
setuptools==69.2.0
diff --git a/src/main/python/main.py b/src/main/python/main.py
index 1012acf..bab32b7 100644
--- a/src/main/python/main.py
+++ b/src/main/python/main.py
@@ -12,6 +12,7 @@ import certifi
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QApplication
+from multiprocessing import freeze_support
from main_window import MainWindow
# http://timlehr.com/python-exception-hooks-with-qt-message-box/
@@ -107,6 +108,9 @@ class VialApplicationContext():
if __name__ == '__main__':
+ # https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html#multi-processing
+ freeze_support()
+
if len(sys.argv) == 2 and sys.argv[1] == "--linux-recorder":
from linux_keystroke_recorder import linux_keystroke_recorder |
| --add-data="../src/build/settings/mac.json:resources/settings" \ | ||
| --windowed \ | ||
| --noupx \ | ||
| --icon="../src/main/icons/Icon.ico" |
There was a problem hiding this comment.
| --icon="../src/main/icons/Icon.ico" | |
| --icon="../src/main/icons/Icon.ico" \ |
Added a missing trailing slash, which is needed for the CLI to run.
|
Works for me on Windows 11 with Python 3.12. Thanks @dwlocks. |
|
This seems like a good direction. Is there anything that remains to be done? |
|
It runs on ubuntu 22.04 with a python 3.12 from PPA. I hope this gets merged soon 👍 |
|
Has there been any progress on this? I wanted to contribute a feature but gave up trying to build the project after a few hours. (Am on linux.) Really a bummer that vial is stuck on fbs and its questionable practices. EDIT: i found the pyinstaller branch and that one built for me after i relaxed the pyinstaller dependency. I guess that's the one i'm working with then |
I rebased that branch onto head, updated python to 3.12, updated Qt5 to latest, and allowed all dependencies to update accordingly. Then i removed FBS and implemented the minimum I could see that was needed to run (on windows).
This involved adding a couple json to the Vial.spec, some code to load those files, and the minimum possible amount of refactoring. There's more code that could be simplified with FBS gone, but I didn't want to go too far before getting some input and maybe getting someone to test on linux. I haven't kept a full vm handy for a couple years now...