Skip to content

type more modules - #134

Draft
ndrwbrwn wants to merge 9 commits into
mainfrom
more-types
Draft

type more modules#134
ndrwbrwn wants to merge 9 commits into
mainfrom
more-types

Conversation

@ndrwbrwn

@ndrwbrwn ndrwbrwn commented Jul 1, 2023

Copy link
Copy Markdown
Member

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

@ndrwbrwn ndrwbrwn linked an issue Jul 1, 2023 that may be closed by this pull request
49Indium
49Indium previously approved these changes Jul 2, 2023

@49Indium 49Indium left a comment

Copy link
Copy Markdown
Member

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.

Comment thread uqcsbot/gaming.py
min_players: int
max_players: int
name: str
score: Union[str, None]

Copy link
Copy Markdown
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
Copy Markdown
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:

Comment thread uqcsbot/gaming.py
@JamesDearlove

Copy link
Copy Markdown
Member

Marking as draft as its uh, not complete

@JamesDearlove
JamesDearlove marked this pull request as draft July 2, 2023 08:03
@ndrwbrwn

Copy link
Copy Markdown
Member Author

Marking as draft as its uh, not complete

wdym this is clearly ready for merge.
(ty)

@ndrwbrwn ndrwbrwn added the help wanted Extra attention is needed label Oct 28, 2023
@jenseni-git jenseni-git self-assigned this Nov 8, 2023
@ndrwbrwn

ndrwbrwn commented Nov 8, 2023

Copy link
Copy Markdown
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

49Indium commented Mar 6, 2024

Copy link
Copy Markdown
Member

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

49Indium commented Mar 7, 2024

Copy link
Copy Markdown
Member

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