Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyinstaller branch rebase and fbs removal #238

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dwlocks
Copy link

@dwlocks dwlocks commented Apr 17, 2024

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...

xyzz and others added 7 commits April 7, 2024 22:11
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
@dwlocks dwlocks mentioned this pull request Apr 17, 2024
@dwlocks dwlocks force-pushed the pyinstaller-rebase branch 2 times, most recently from 721338d to 0794bcc Compare April 17, 2024 06:21
@jashort
Copy link

jashort commented May 2, 2024

Anecdotally, this seems to work on Linux for me.
Fedora Linux 40, Python 3.12.2, and following instructions in README.md

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.

@dwlocks
Copy link
Author

dwlocks commented May 4, 2024

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".

@koallen
Copy link

koallen commented Jul 9, 2024

I managed to build this on a Mac but seems like it keeps opening new windows for some reason.

@tuopppi
Copy link

tuopppi commented Jul 30, 2024

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

@limexp
Copy link

limexp commented Aug 14, 2024

This PR saved me a lot of time trying to build on Windows.

@dwlocks, could you implement changes suggested by @tuopppi in the previous comment to push this PR forward?

@dwlocks
Copy link
Author

dwlocks commented Aug 14, 2024

This PR saved me a lot of time trying to build on Windows.

@dwlocks, could you implement changes suggested by @tuopppi in the previous comment to push this PR forward?
Unfortunately, you're overestimating my role: I can't move the PR forward. Only the repository owners/developers can accept PRs. I have strong doubts if this project is still active, sadly.

@dwlocks
Copy link
Author

dwlocks commented Aug 14, 2024

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:

from multiprocessing import RLock

Would you mind sending a patch for where this goes?

@tuopppi
Copy link

tuopppi commented Sep 13, 2024

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

@wez
Copy link

wez commented Oct 2, 2024

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

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.

7 participants