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

Add type hints to UserInterface class #348

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Jun 13, 2024

Add type hints to all occurrences of the UserInterface class.

mypy on jammy has false positives:

kde/apport-kde:441: error: Argument 1 to "information" of "QMessageBox" has incompatible type "None"; expected "QWidget"
kde/apport-kde:444: error: Argument 1 to "information" of "QMessageBox" has incompatible type "None"; expected "QWidget"
kde/apport-kde:535: error: Argument 1 to "question" of "QMessageBox" has incompatible type "None"; expected "QWidget"

Do not install python3-pyqt5 on jammy to avoid those false positives.

@bdrung bdrung requested a review from schopin-pro June 13, 2024 13:44
@bdrung
Copy link
Collaborator Author

bdrung commented Jun 13, 2024

The CI is green except that upload-to-codecov is failing.

`MainUserInterface.ui_start_info_collection_progress` is expected to be
called before `MainUserInterface.ui_stop_info_collection_progress`.
After the call of `MainUserInterface.ui_start_info_collection_progress`
either `MainUserInterface.dialog` or `MainUserInterface.progress` is
set.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
`MainUserInterface.ui_start_upload_progress` is expected to be called
before `MainUserInterface.ui_stop_upload_progress`. The former will set
MainUserInterface.progress`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Add type hints to all occurrences of the `UserInterface` class.

mypy on jammy has false positives:

```
kde/apport-kde:441: error: Argument 1 to "information" of "QMessageBox" has incompatible type "None"; expected "QWidget"
kde/apport-kde:444: error: Argument 1 to "information" of "QMessageBox" has incompatible type "None"; expected "QWidget"
kde/apport-kde:535: error: Argument 1 to "question" of "QMessageBox" has incompatible type "None"; expected "QWidget"
```

Do not install `python3-pyqt5` on jammy to avoid those false positives.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
@schopin-pro schopin-pro merged commit c997c1b into canonical:main Jun 21, 2024
15 of 16 checks passed
@bdrung bdrung deleted the type-hints-ui branch June 21, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants