Skip to content

Commit

Permalink
Add PySide6 dependency for Windows and MacOS
Browse files Browse the repository at this point in the history
We're not yet adding them to Linux, since PySide6 is not yet available
in Linux distros' packages, whereas with Linux and macOS our packaging
process includes the shipped binaries.

Fixes freedomofpress#211
  • Loading branch information
deeplow committed Feb 8, 2023
1 parent d9110ce commit ca6f3a4
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 5 deletions.
78 changes: 77 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ license = "MIT"
python = ">=3.7,<3.11"
click = "*"
appdirs = "*"
PySide2 = "5.15.2.1"
PySide2 = {version = "5.15.2.1", platform = "linux"}
PySide6 = {version = "^6.4.1", markers = "sys_platform == 'win32' or sys_platform == 'darwin'"}
colorama = "*"
pyxdg = {version = "*", platform = "linux"}
openai-whisper = "^20230124"
Expand Down
11 changes: 10 additions & 1 deletion whisperzone/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@
import platform
import signal
import sys
import typing
import uuid
from typing import Dict, List, Optional

import click
import colorama
from PySide2 import QtCore, QtGui, QtWidgets

# FIXME: See https://github.com/freedomofpress/dangerzone/issues/320 for more details.
if typing.TYPE_CHECKING:
from PySide2 import QtCore, QtGui, QtWidgets
else:
try:
from PySide6 import QtCore, QtGui, QtWidgets
except ImportError:
from PySide2 import QtCore, QtGui, QtWidgets

from .. import args, errors
from ..converter import Converter
Expand Down
11 changes: 10 additions & 1 deletion whisperzone/gui/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
import platform
import shlex
import subprocess
import typing
from pathlib import Path
from typing import Dict

from colorama import Fore
from PySide2 import QtCore, QtGui, QtWidgets

# FIXME: See https://github.com/freedomofpress/dangerzone/issues/320 for more details.
if typing.TYPE_CHECKING:
from PySide2 import QtCore, QtGui, QtWidgets
else:
try:
from PySide6 import QtCore, QtGui, QtWidgets
except ImportError:
from PySide2 import QtCore, QtGui, QtWidgets

if platform.system() == "Linux":
from xdg.DesktopEntry import DesktopEntry
Expand Down
11 changes: 10 additions & 1 deletion whisperzone/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
import subprocess
import tempfile
from abc import abstractmethod
import typing
from multiprocessing.pool import ThreadPool
from typing import List, Optional

from colorama import Fore, Style
from PySide2 import QtCore, QtGui, QtWidgets

# FIXME: See https://github.com/freedomofpress/dangerzone/issues/320 for more details.
if typing.TYPE_CHECKING:
from PySide2 import QtCore, QtGui, QtWidgets
else:
try:
from PySide6 import QtCore, QtGui, QtWidgets
except ImportError:
from PySide2 import QtCore, QtGui, QtWidgets

from .. import errors
from ..document import SAFE_EXTENSION, Document
Expand Down

0 comments on commit ca6f3a4

Please sign in to comment.