Skip to content

Commit

Permalink
Merge pull request #1135 from Gatsik/pyqt6
Browse files Browse the repository at this point in the history
Make it operational again
  • Loading branch information
Gatsik authored Jun 6, 2024
2 parents 326321e + b82e3d3 commit 74ecc71
Show file tree
Hide file tree
Showing 222 changed files with 5,441 additions and 4,823 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,20 @@ on:
jobs:
checks:
runs-on: windows-latest
env:
PYWHEEL_INFIX: "cp36"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.6.7
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.6.7
architecture: x86
python-version: 3.12
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sip==4.19.8
pip install pyqt5==5.7.1
pip install https://github.com/FAForever/python-wheels/releases/download/2.0.0/pywin32-221-${{ env.PYWHEEL_INFIX }}-${{ env.PYWHEEL_INFIX }}m-win32.whl
pip install wheel
pip install pytest
pip install cx_Freeze==5.0.2
pip install -r requirements.txt
- name: Copy required dlls
run: |
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\pywin32_system32 .
- name: Test with pytest
run: |
python runtests.py -vv --full-trace
90 changes: 30 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,32 @@ jobs:
environment: deploy
runs-on: windows-latest
env:
UID_VERSION: v4.0.4
ICE_ADAPTER_VERSION: v3.1.2
PYWHEEL_INFIX: "cp36"
UID_VERSION: v4.0.6
ICE_ADAPTER_VERSION: v3.3.7
BUILD_VERSION: ${{ github.event.inputs.version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.6.7
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.6.7
architecture: x86
python-version: 3.12
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sip==4.19.8
pip install pyqt5==5.7.1
pip install https://github.com/FAForever/python-wheels/releases/download/2.0.0/pywin32-221-${{ env.PYWHEEL_INFIX }}-${{ env.PYWHEEL_INFIX }}m-win32.whl
pip install wheel
pip install pytest
pip install cx_Freeze==5.0.2
pip install -r requirements.txt
- name: Copy required files for packaging in setup.py
run: |
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\PyQt5\\Qt\\plugins\\imageformats .\\imageformats /I
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\PyQt5\\Qt\\plugins\\platforms .\\platforms /I
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\PyQt5\\Qt\\plugins\\audio .\\audio /I
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\PyQt5\\Qt\\bin .
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\pywin32_system32 .
xcopy ${{ env.pythonLocation }}\\lib\\site-packages\\PyQt5\\Qt\\resources . /I
python -m pip install -r requirements.txt
- name: Download ICE adapter and UID calculator
run: |
mkdir lib\ice-adapter
Invoke-WebRequest -Uri "https://github.com/FAForever/uid/releases/download/$($env:UID_VERSION)/faf-uid.exe" -OutFile ".\\lib\\faf-uid.exe"
Invoke-WebRequest -Uri "https://github.com/FAForever/java-ice-adapter/releases/download/v1.0.0/faf-ice-adapter-jre-base.7z" -OutFile ".\\faf-ice-adapter-jre-base.7z"
7z x faf-ice-adapter-jre-base.7z -olib
Remove-Item .\lib\ice-adapter\jre -Force -Recurse
Remove-Item .\lib\ice-adapter\LICENSE.txt -Force -Recurse
Invoke-WebRequest -Uri "https://content.faforever.com/jre/windows-amd64-15.0.1.tar.gz" -OutFile ".\\windows-amd64-15.0.1.tar.gz"
mkdir build_setup\ice-adapter
Invoke-WebRequest -Uri "https://github.com/FAForever/uid/releases/download/$($env:UID_VERSION)/faf-uid.exe" -OutFile ".\\build_setup\\faf-uid.exe"
Invoke-WebRequest -Uri "https://content.faforever.com/build/jre/windows-amd64-21.0.1.tar.gz" -OutFile ".\\windows-amd64-15.0.1.tar.gz"
7z x windows-amd64-15.0.1.tar.gz
7z x windows-amd64-15.0.1.tar -olib/ice-adapter/jre
Invoke-WebRequest -Uri "https://github.com/FAForever/java-ice-adapter/releases/download/$($env:ICE_ADAPTER_VERSION)/faf-ice-adapter.jar" -OutFile ".\\lib\\ice-adapter\\faf-ice-adapter.jar"
7z x windows-amd64-15.0.1.tar -obuild_setup/ice-adapter/jre
Invoke-WebRequest -Uri "https://github.com/FAForever/java-ice-adapter/releases/download/$($env:ICE_ADAPTER_VERSION)/faf-ice-adapter-$($env:ICE_ADAPTER_VERSION)-win.jar" -OutFile ".\\build_setup\\ice-adapter\\faf-ice-adapter.jar"
- name: Test with pytest
run: |
Expand All @@ -75,37 +55,27 @@ jobs:
(Get-Item $files).FullName
}
$WINDOWS_MSI = getMsiPath
Write-Host $WINDOWS_MSI
Write-Host "MSI path: $WINDOWS_MSI"
$WINDOWS_MSI_NAME = (Get-Item $WINDOWS_MSI).Name
Write-Host $WINDOWS_MSI_NAME
echo "::set-output name=WINDOWS_MSI::${WINDOWS_MSI}"
echo "::set-output name=WINDOWS_MSI_NAME::${WINDOWS_MSI_NAME}"
Write-Host "MSI name: $WINDOWS_MSI_NAME"
echo "WINDOWS_MSI=$WINDOWS_MSI" >> "$env:GITHUB_ENV"
echo "WINDOWS_MSI_NAME=$WINDOWS_MSI_NAME" >> "$env:GITHUB_ENV"
- name: Calculate checksum
id: checksum
run: |
Write-Host MSI path is: $env:WINDOWS_MSI
$MSI_SUM = $(Get-FileHash $env:WINDOWS_MSI).hash
Write-Host $MSI_SUM
echo "MSI_SUM=$MSI_SUM" >> "$env:GITHUB_ENV"
- name: Create draft release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/[email protected]
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
commit: ${{ github.sha }}
tag: ${{ github.event.inputs.version }}
body: "SHA256: ${{ env.MSI_SUM }}"
draft: true
prerelease: true

- name: Check release paths
run: |
echo "MSI path:"
Write-Host ${{ steps.artifact_paths.outputs.WINDOWS_MSI }}
echo "MSI filename:"
Write-Host ${{ steps.artifact_paths.outputs.WINDOWS_MSI_NAME }}
- name: Upload Windows msi
id: upload-msi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.artifact_paths.outputs.WINDOWS_MSI }}
asset_name: ${{ steps.artifact_paths.outputs.WINDOWS_MSI_NAME }}
asset_content_type: application/vnd.microsoft.portable-executable
artifacts: ${{ env.WINDOWS_MSI }}
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
*.vcproj
.idea/
lib/
natives/
build/
build_setup/
dist/
Thumbs.db
.DS_Store
Expand All @@ -24,12 +26,3 @@ client_venv
*.egg-info
.vagrant
.cache
*.dll
*.exe
*.pac
*.conf
*.dat
audio
imageformats
platforms
*.json
12 changes: 4 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.2
rev: v3.1.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def application(qapp, request):

@pytest.fixture(scope="function")
def signal_receiver(application):
from PyQt5 import QtCore
from PyQt6 import QtCore

class SignalReceiver(QtCore.QObject):
def __init__(self, parent=None):
Expand Down
3 changes: 0 additions & 3 deletions lib/qt.conf

This file was deleted.

Binary file removed lib/xdelta3.exe
Binary file not shown.
20 changes: 10 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
cx_Freeze==5.0.2
cx_Freeze
idna
ipaddress
irc
jinja2
pathlib
pyqt5
pydantic
pyqt6
pyqt6-networkauth
pytest
pytest-cov
pytest-mock
pytest-qt==3.3.0
semantic_version==2.8.5
idna
jsonschema==2.6.0
jinja2
pytest-qt
pywin32
semantic_version
zstandard
irc
oauthlib
requests_oauthlib
70 changes: 70 additions & 0 deletions res/client/change_style.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="stylesList"/>
</item>
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Apply|QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Loading

0 comments on commit 74ecc71

Please sign in to comment.