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

Mypy database + pytest in CI #5327

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

qarmin
Copy link
Contributor

@qarmin qarmin commented Feb 25, 2024

  • Adds some types to files in database folder
  • Adds pytest to CI
  • Changed GObject.SIGNAL_RUN_FIRST to GObject.SignalFlags.RUN_FIRST - fixed a lot of deprecated warnings in pytest
  • Run CI on pull request and push(previously was only on pull request, but I see that not always PR are created in this project)
  • Disabled 2 tests, that fails on my computer, but not on CI - flaky tests are not really usable

Currently pytest fails due strange error(help needed to fix this):

 self = <add_game_dialog.AddGameDialog object at 0x7fbcc07674c0 (uninitialized at 0x(nil))>
args = ()
kwargs = {'border_width': 0, 'title': 'Add a new game', 'transient_for': None, 'use_header_bar': True}

    def __init__(self, *args, **kwargs):
        if not initialized:
>           raise RuntimeError(
                "Gtk couldn't be initialized. "
                "Use Gtk.init_check() if you want to handle this case.")
E           RuntimeError: Gtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.

/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/gi/overrides/Gtk.py:508: RuntimeError

Database typing is quite tricky, because python type every variable from database as Any.

Rest of typing should do person that knows better code/structure of app/real variable types

@qarmin qarmin marked this pull request as draft February 28, 2024 17:52
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.

None yet

1 participant