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

type more modules #134

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

type more modules #134

wants to merge 9 commits into from

Conversation

andrewj-brown
Copy link
Member

@andrewj-brown andrewj-brown commented Jul 1, 2023

Now #114 is merged, this'll be the branch where I work through the rest of our cogs and get them all to pass pyright. Note that a couple of these cogs will be typed in other outstanding PRs.

List including all cogs not typed as of this PR's opening:

  • advent.py
  • bot.py
  • error_handler.py
  • events.py
  • gaming.py
  • haiku.py
  • remindme.py
  • snailrace.py
  • starboard.py
  • whatsdue.py
  • working_on.py
  • uptime.py
  • utils/command_utils.py
  • utils/uq_course_utils.py

@andrewj-brown andrewj-brown linked an issue Jul 1, 2023 that may be closed by this pull request
49Indium
49Indium previously approved these changes Jul 2, 2023
Copy link
Member

@49Indium 49Indium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm liking Pyright so far. Looking forward to it being across the bot.

min_players: int
max_players: int
name: str
score: Union[str, None]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would Optional[str] be more appropriate? Same for the other parameters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but i'm braindead. will fix soon:tm:

uqcsbot/gaming.py Show resolved Hide resolved
@JamesDearlove
Copy link
Member

Marking as draft as its uh, not complete

@JamesDearlove JamesDearlove marked this pull request as draft July 2, 2023 08:03
@andrewj-brown
Copy link
Member Author

Marking as draft as its uh, not complete

wdym this is clearly ready for merge.
(ty)

@andrewj-brown andrewj-brown added the help wanted Extra attention is needed label Oct 28, 2023
@jenseni-git jenseni-git self-assigned this Nov 8, 2023
@andrewj-brown
Copy link
Member Author

Final thing for this PR: investigate the exemptor in yelling.py, with the goal of removing the #type: ignore (It's complaining about unknown inner types in InteractionResponse, which I suspect is caused by the fucked typecasting all over the place.)

@49Indium
Copy link
Member

49Indium commented Mar 6, 2024

After merging in main, advent.py, uq_course_utils.py and whatsdue.py should now be fixed (as they were typed in #183, #125 and #125 respectively). Also, snailrace.py, uptime.py and working_on.py are currently not type checked on main as well..

@49Indium
Copy link
Member

49Indium commented Mar 7, 2024

My thoughts on the progress of this:

  • bot.py requires the stubs from apscheduler to be reasonable to type, which is said to come out in 4.0, so we might be waiting...
  • events.py requires stubs from icalendar to have useful typing. I couldn't find these, and have no clue if they will ever exist.
  • remindme.py has 4 type errors. 2 are easily solvable (remove lines that we now know are unnecessary from the type checker). The other two don't seem so bad, but relate to the time_created field of the Reminders database table. In the schema, time_created is typed Mapped[int], but seems to store a date time. I don't remember how to access the database to check if this is a typing mistake or actually occurs in the database (and I don't want to break a feature that is hard to test). Any advice would be helpful on this point.
  • snailrace.py is due for wither reworking, upgrading or removal IMO, so I did not check it.
  • starboard.py already has reorder db interactions and add types to starboard.py #123 to fix its types
  • error_handler.py, uptime.py and working_on.py should all be fixed by Fixed various typing issues #195

I'm optimistic. It's looking like steady progress is being made, but that we might be waiting on stubs if we want to type all of this.

@jenseni-git jenseni-git removed their assignment Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic type-checking and annotations
4 participants