Skip to content

Commit

Permalink
Revert "gui: upgrade to PySide6 (bug 1782252) (#1083)" (#1090)
Browse files Browse the repository at this point in the history
This reverts commit c5757c2.
  • Loading branch information
zzzeid authored Aug 17, 2022
1 parent c5757c2 commit 5ccd5a8
Show file tree
Hide file tree
Showing 47 changed files with 1,301 additions and 268 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -25,8 +25,8 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements/requirements-3.9-Linux.txt
python -m pip install -e .
pip install -r requirements/requirements-3.9-Linux.txt
pip install -e .
- name: Lint
run: |
source env/bin/activate
Expand All @@ -39,14 +39,10 @@ jobs:
strategy:
matrix:
os:
- ubuntu-20.04
python-version: ["3.7", "3.8", "3.9", "3.10"]
- ubuntu-18.04
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo apt-get update
sudo apt-get install libegl-dev -y
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -56,16 +52,16 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements/requirements-${{ matrix.python-version }}-${{ runner.os }}.txt
python -m pip install -e .
pip install -r requirements/requirements-${{ matrix.python-version }}-${{ runner.os }}.txt
pip install -e .
- name: Test
run: |
source env/bin/activate
coverage run -m pytest tests
coveralls --service=github
build-and-test-linux-gui:
runs-on: ubuntu-20.04
runs-on: ubuntu-18.04
env:
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -74,8 +70,7 @@ jobs:
- uses: actions/checkout@v2
- name: setup
run: |
sudo apt-get update
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libegl-dev -y
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -86,8 +81,8 @@ jobs:
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements/requirements-3.9-Linux.txt
python -m pip install -e .
pip install -r requirements/requirements-3.9-Linux.txt
pip install -e .
- name: Build
run: |
source env/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-compile-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
requirements_files: '["base.in dev.in gui-dev.in gui.in linters.in"]'
os: '["ubuntu-latest"]'
python: '["3.7", "3.8", "3.9", "3.10"]'
python: '["3.6", "3.7", "3.8", "3.9", "3.10"]'

call-compile-requirements-windows:
needs: call-compile-requirements-linux
Expand Down
8 changes: 4 additions & 4 deletions gui/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def do_uic(options, force=False):
or (os.path.getmtime(uifile) > os.path.getmtime(pyfile))
):
print("uic'ing %s -> %s" % (uifile, pyfile))
os.system("pyside6-uic {} > {}".format(uifile, pyfile))
os.system("pyside2-uic {} > {}".format(uifile, pyfile))


def do_rcc(options, force=False):
Expand All @@ -83,7 +83,7 @@ def do_rcc(options, force=False):
or (os.path.getmtime(rccfile) > os.path.getmtime(pyfile))
):
print("rcc'ing %s -> %s" % (rccfile, pyfile))
call("pyside6-rcc", "-o", pyfile, rccfile)
call("pyside2-rcc", "-o", pyfile, rccfile)


def do_run(options):
Expand Down Expand Up @@ -113,7 +113,7 @@ def do_bundle(options):
# create a bundle for the application
call("pyinstaller", "gui.spec")

# remove any pyside6 files we don't need
# remove any pyside2 files we don't need
unwanted_re = "|".join(UNWANTED_PYSIDE_LIBRARIES)
for root, dirs, filenames in os.walk("dist"):
qt_filenames = [
Expand Down Expand Up @@ -151,7 +151,7 @@ def do_bundle(options):
else:
# seems like some qml stuff is also bundled on Linux
try:
shutil.rmtree(os.path.join("dist", "mozregression-gui", "PySide6", "qml"))
shutil.rmtree(os.path.join("dist", "mozregression-gui", "PySide2", "qml"))
except FileNotFoundError:
pass
with tarfile.open("mozregression-gui.tar.gz", "w:gz") as tar:
Expand Down
8 changes: 4 additions & 4 deletions gui/mozregui/addons_editor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide6.QtCore import QAbstractListModel, QModelIndex, Qt, Slot
from PySide6.QtWidgets import QFileDialog, QWidget
from PySide2.QtCore import QAbstractListModel, QModelIndex, Qt, Slot
from PySide2.QtWidgets import QFileDialog, QWidget

from mozregui.ui.addons_editor import Ui_AddonsEditor

Expand Down Expand Up @@ -72,9 +72,9 @@ def get_addons(self):


if __name__ == "__main__":
from PySide6.QtWidgets import QApplication
from PySide2.QtWidgets import QApplication

app = QApplication([])
view = AddonsWidgetEditor()
view.show()
app.exec()
app.exec_()
4 changes: 2 additions & 2 deletions gui/mozregui/bisection.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
import threading

from PySide6.QtCore import QObject, QTimer, Signal, Slot
from PySide6.QtWidgets import QMessageBox
from PySide2.QtCore import QObject, QTimer, Signal, Slot
from PySide2.QtWidgets import QMessageBox

from mozregression.approx_persist import ApproxPersistChooser
from mozregression.bisector import (
Expand Down
2 changes: 1 addition & 1 deletion gui/mozregui/build_runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide6.QtCore import QObject, QThread, QTimer, Signal, Slot
from PySide2.QtCore import QObject, QThread, QTimer, Signal, Slot

from mozregression.download_manager import BuildDownloadManager
from mozregression.errors import LauncherError, MozRegressionError
Expand Down
6 changes: 3 additions & 3 deletions gui/mozregui/check_release.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import QObject, Qt, QThread, QUrl, Slot
from PySide6.QtGui import QDesktopServices
from PySide6.QtWidgets import QLabel
from PySide2.QtCore import QObject, Qt, QThread, QUrl, Slot
from PySide2.QtGui import QDesktopServices
from PySide2.QtWidgets import QLabel

from mozregression import __version__ as mozregression_version
from mozregression.network import retry_get
Expand Down
6 changes: 3 additions & 3 deletions gui/mozregui/crash_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import sys
import traceback

from PySide6.QtCore import QObject, Qt, Signal, Slot
from PySide6.QtWidgets import QDialog
from PySide2.QtCore import QObject, Qt, Signal, Slot
from PySide2.QtWidgets import QDialog

import mozregression

Expand Down Expand Up @@ -74,5 +74,5 @@ def display_dialog(self, err):
self.on_prevent_dialog_checked
)
self.current_dialog.set_exception(*err)
self.current_dialog.exec()
self.current_dialog.exec_()
self.current_dialog = None
4 changes: 2 additions & 2 deletions gui/mozregui/global_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from configobj import ConfigObj
from glean import Glean
from PySide6.QtWidgets import QDialog
from PySide2.QtWidgets import QDialog

from mozregression.config import ARCHIVE_BASE_URL, DEFAULT_CONF_FNAME, get_config
from mozregression.network import set_http_session
Expand Down Expand Up @@ -132,5 +132,5 @@ def change_prefs_dialog(parent=None):
A dialog to change global prefs. This does not apply the prefs.
"""
dlg = ChangePrefsDialog(parent)
if dlg.exec() == QDialog.Accepted:
if dlg.exec_() == QDialog.Accepted:
dlg.save_prefs()
13 changes: 3 additions & 10 deletions gui/mozregui/log_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@

from mozlog import get_default_logger
from mozlog.structuredlog import log_levels
from PySide6.QtCore import QObject, Signal, Slot
from PySide6.QtGui import (
QAction,
QActionGroup,
QColor,
QTextBlockUserData,
QTextCharFormat,
QTextCursor,
)
from PySide6.QtWidgets import QMenu, QPlainTextEdit
from PySide2.QtCore import QObject, Signal, Slot
from PySide2.QtGui import QColor, QTextBlockUserData, QTextCharFormat, QTextCursor
from PySide2.QtWidgets import QAction, QActionGroup, QMenu, QPlainTextEdit

COLORS = {
"DEBUG": QColor(6, 146, 6), # green
Expand Down
6 changes: 3 additions & 3 deletions gui/mozregui/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys

from mozlog.structuredlog import StructuredLogger, set_default_logger
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QApplication

from mozregression.log import init_python_redirect_logger

Expand Down Expand Up @@ -43,7 +43,7 @@ def main():
log_model.log.connect(win.ui.log_view.on_log_received)
win.show()
# Enter Qt application main loop
sys.exit(app.exec())
sys.exit(app.exec_())


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions gui/mozregui/mainwindow.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from tempfile import mkdtemp

import mozfile
from PySide6.QtCore import QSettings, Slot
from PySide6.QtWidgets import QMainWindow, QMessageBox
from PySide2.QtCore import QSettings, Slot
from PySide2.QtWidgets import QMainWindow, QMessageBox

from mozregression import __version__ as mozregression_version
from mozregression.telemetry import initialize_telemetry
Expand Down Expand Up @@ -92,7 +92,7 @@ def closeEvent(self, evt):

def _start_runner(self, wizard_class, runner):
wizard = wizard_class(self)
if wizard.exec() == wizard.Accepted:
if wizard.exec_() == wizard.Accepted:
self.current_runner = runner
# clear the report model
self.ui.report_view.model().clear()
Expand Down
8 changes: 4 additions & 4 deletions gui/mozregui/pref_editor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from mozprofile.prefs import Preferences
from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, Slot
from PySide6.QtWidgets import QFileDialog, QWidget
from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt, Slot
from PySide2.QtWidgets import QFileDialog, QWidget

from mozregui.ui.pref_editor import Ui_PrefEditor

Expand Down Expand Up @@ -113,9 +113,9 @@ def get_prefs(self):


if __name__ == "__main__":
from PySide6.QtWidgets import QApplication
from PySide2.QtWidgets import QApplication

app = QApplication([])
view = PreferencesWidgetEditor()
view.show()
app.exec()
app.exec_()
6 changes: 3 additions & 3 deletions gui/mozregui/report.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, QUrl, Signal, Slot
from PySide6.QtGui import QColor, QDesktopServices
from PySide6.QtWidgets import QTableView, QTextBrowser
from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt, QUrl, Signal, Slot
from PySide2.QtGui import QColor, QDesktopServices
from PySide2.QtWidgets import QTableView, QTextBrowser

from mozregression.bisector import NightlyHandler

Expand Down
6 changes: 3 additions & 3 deletions gui/mozregui/report_delegate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import QRect, Qt, Signal
from PySide6.QtGui import QIcon, QPainter, QPixmap
from PySide6.QtWidgets import (
from PySide2.QtCore import QRect, Qt, Signal
from PySide2.QtGui import QIcon, QPainter, QPixmap
from PySide2.QtWidgets import (
QApplication,
QStyle,
QStyledItemDelegate,
Expand Down
4 changes: 2 additions & 2 deletions gui/mozregui/single_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide6.QtCore import QObject, Signal, Slot
from PySide6.QtWidgets import QMessageBox
from PySide2.QtCore import QObject, Signal, Slot
from PySide2.QtWidgets import QMessageBox

from mozregression.dates import is_date_or_datetime
from mozregression.errors import MozRegressionError
Expand Down
10 changes: 5 additions & 5 deletions gui/mozregui/skip_chooser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import QBrush
from PySide6.QtWidgets import (
from PySide2.QtCore import Qt, Signal
from PySide2.QtGui import QBrush
from PySide2.QtWidgets import (
QDialog,
QGraphicsRectItem,
QGraphicsScene,
Expand Down Expand Up @@ -117,7 +117,7 @@ def build_index(self, item):
return self.scene.build_range.future_build_infos.index(item.future_build_info)

def choose_next_build(self):
if self.exec() == self.Accepted:
if self.exec_() == self.Accepted:
items = self.scene.selectedItems()
assert len(items) == 1
return self.build_index(items[0])
Expand Down Expand Up @@ -148,7 +148,7 @@ def _fetch(self):

build_range = BuildRange(None, [FInfo(None, i) for i in range(420)])

from PySide6.QtWidgets import QApplication, QMainWindow
from PySide2.QtWidgets import QApplication, QMainWindow

app = QApplication([])
win = QMainWindow()
Expand Down
4 changes: 2 additions & 2 deletions gui/mozregui/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PySide6.QtCore import QDir
from PySide6.QtWidgets import (
from PySide2.QtCore import QDir
from PySide2.QtWidgets import (
QCompleter,
QFileDialog,
QFileSystemModel,
Expand Down
4 changes: 2 additions & 2 deletions gui/mozregui/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import datetime

import mozinfo
from PySide6.QtCore import SIGNAL, QDate, QStringListModel, Qt, Slot
from PySide6.QtWidgets import QApplication, QCompleter, QMessageBox, QWizard, QWizardPage
from PySide2.QtCore import SIGNAL, QDate, QStringListModel, Qt, Slot
from PySide2.QtWidgets import QApplication, QCompleter, QMessageBox, QWizard, QWizardPage

from mozregression.branches import get_branches
from mozregression.dates import to_datetime
Expand Down
2 changes: 1 addition & 1 deletion gui/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

from PySide6.QtWidgets import QApplication
from PySide2.QtWidgets import QApplication

if sys.platform == "linux":
os.environ["QT_QPA_PLATFORM"] = "offscreen"
Expand Down
5 changes: 2 additions & 3 deletions gui/tests/test_addons_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import mozfile
import pytest
from mock import patch
from PySide6.QtCore import Qt
from PySide2.QtCore import Qt

from mozregui.addons_editor import AddonsWidgetEditor

Expand All @@ -17,8 +17,7 @@ def addons_editor(qtbot):
widget = AddonsWidgetEditor()
qtbot.addWidget(widget)
widget.show()
with qtbot.waitExposed(widget):
pass
qtbot.waitForWindowShown(widget)
return widget


Expand Down
2 changes: 1 addition & 1 deletion gui/tests/test_build_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest
from mock import Mock, patch
from PySide6.QtCore import QObject, QThread, Signal, Slot
from PySide2.QtCore import QObject, QThread, Signal, Slot

from mozregression.fetch_configs import create_config
from mozregression.persist_limit import PersistLimit
Expand Down
Loading

0 comments on commit 5ccd5a8

Please sign in to comment.