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

Enable PyQt5 type checking #1611

Merged
merged 24 commits into from
Jan 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
64293d1
Add PyQt5 stub library for mypy
gonzalo-bulnes Dec 14, 2022
25ee35b
Fix type hint: pyqtBoundSignal
gonzalo-bulnes Dec 14, 2022
0a1181e
Refactor rely on default signal connection type
gonzalo-bulnes Dec 14, 2022
0c26f06
Fix incorrect assignation to built-in methods
gonzalo-bulnes Dec 15, 2022
0edd853
Fix type hint: QSize
gonzalo-bulnes Dec 15, 2022
c4248bb
Ignore missing type hint
gonzalo-bulnes Dec 15, 2022
c5df0f2
Fix missing QueueJob attribute
gonzalo-bulnes Dec 15, 2022
828c17c
Fix method signature incompatible with supertype's
gonzalo-bulnes Dec 15, 2022
9a9e343
Ignore undefined attribute in QApplication
gonzalo-bulnes Dec 15, 2022
54f61eb
Fix type hint: Optional[QWidget]
gonzalo-bulnes Dec 15, 2022
787b212
Fix method signature incompatible with supertype's
gonzalo-bulnes Dec 15, 2022
e0173f5
Fix missing type hints in comparison method
gonzalo-bulnes Dec 15, 2022
da14362
Fix method signature incompatible with supertype's
gonzalo-bulnes Dec 20, 2022
69f923a
Fix missing type hint: SourceWidget
gonzalo-bulnes Dec 20, 2022
6c49ad3
Fix missing type hint: SourceWidget
gonzalo-bulnes Dec 20, 2022
f2b09ff
Fix missing type hints: SourceWidget
gonzalo-bulnes Dec 20, 2022
00d11b5
Fix missing type hint: conversation widgets
gonzalo-bulnes Dec 20, 2022
874ff14
Fix missing type hint: converssation messages
gonzalo-bulnes Dec 20, 2022
df6ceb7
Fix missing type hints: QMouseEvent
gonzalo-bulnes Dec 20, 2022
64a2f3b
Fix incompatible type in assignment
gonzalo-bulnes Dec 20, 2022
51609f9
Fix method signature incompatible with supertype's
gonzalo-bulnes Dec 20, 2022
10a309d
Fix move misplaced import to top of module
gonzalo-bulnes Dec 21, 2022
30429af
Refactor use future annotations
gonzalo-bulnes Dec 22, 2022
fc3afca
Add semgrep rule for unsafe assertions
gonzalo-bulnes Dec 22, 2022
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
6 changes: 3 additions & 3 deletions securedrop_client/api_jobs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ def __init__(self, message: Optional[str] = None) -> None:


class QueueJob(QObject):
def __init__(self) -> None:
def __init__(self, remaining_attempts: int = DEFAULT_NUM_ATTEMPTS) -> None:
super().__init__()
self.order_number = None # type: Optional[int]
self.remaining_attempts = remaining_attempts
gonzalo-bulnes marked this conversation as resolved.
Show resolved Hide resolved

def __lt__(self, other: QueueJobType) -> bool:
"""
Expand Down Expand Up @@ -60,8 +61,7 @@ class ApiJob(QueueJob):
failure_signal = pyqtSignal(Exception)

def __init__(self, remaining_attempts: int = DEFAULT_NUM_ATTEMPTS) -> None:
super().__init__()
self.remaining_attempts = remaining_attempts
super().__init__(remaining_attempts)

def _do_call_api(self, api_client: API, session: Session) -> None:
if not api_client:
Expand Down