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

Proton-CachyOS: Remove deprecated Type Hinting #499

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions pupgui2/resources/ctmods/ctmod_protoncachyos.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
# Copyright (C) 2021 DavidoTek, partially based on AUNaseef's protonup

import os
from typing import Dict, Optional, Set
from typing import override

from PySide6.QtCore import QCoreApplication, Signal
from PySide6.QtWidgets import QMessageBox
from PySide6.QtCore import QCoreApplication

from pupgui2.networkutil import download_file
from pupgui2.util import ghapi_rlcheck, extract_tar
from .ctmod_00protonge import CtInstaller as ProtonGECtInstaller

Expand All @@ -35,7 +33,8 @@ class CtInstaller(ProtonGECtInstaller):
CT_URL = 'https://api.github.com/repos/CachyOS/proton-cachyos/releases'
CT_INFO_URL = 'https://github.com/CachyOS/proton-cachyos/releases/tag/'

def __fetch_github_data(self, tag: str, arch: str) -> Optional[Dict]:
@override
def __fetch_github_data(self, tag: str, arch: str) -> dict | None:
"""
Fetch GitHub release information
Return Type: dict
Expand All @@ -56,7 +55,7 @@ def __fetch_github_data(self, tag: str, arch: str) -> Optional[Dict]:
values['size'] = asset['size']
return values

def get_hwcaps(self) -> Set:
def get_hwcaps(self) -> set[str]:
hwcaps = {'x86_64'}
# flags according to https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex
flags_v2 = {'sse4_1', 'sse4_2', 'ssse3'}
Expand All @@ -75,8 +74,8 @@ def get_hwcaps(self) -> Set:
hwcaps.add('x86_64_v2')
return hwcaps


def fetch_releases(self, count: int = 100, page: int = 1):
@override
def fetch_releases(self, count: int = 100, page: int = 1) -> list:
"""
List available releases
Return Type: str[]
Expand All @@ -95,6 +94,7 @@ def fetch_releases(self, count: int = 100, page: int = 1):
assets.append(name)
return assets

@override
def get_tool(self, version: str, install_dir: str, temp_dir: str):
"""
Download and install the compatibility tool
Expand Down Expand Up @@ -139,6 +139,7 @@ def get_tool(self, version: str, install_dir: str, temp_dir: str):

return True

@override
def get_info_url(self, version: str) -> str:
"""
Get link with info about version (eg. GitHub release page)
Expand Down