Skip to content

refactor(various): Add type hints to couple modules in cabotage.utils and cabotage.celery packages - #377

Draft
Alc-Alc wants to merge 19 commits into
cabotage:mainfrom
Alc-Alc:add-types
Draft

refactor(various): Add type hints to couple modules in cabotage.utils and cabotage.celery packages#377
Alc-Alc wants to merge 19 commits into
cabotage:mainfrom
Alc-Alc:add-types

Conversation

@Alc-Alc

@Alc-Alc Alc-Alc commented Jul 13, 2026

Copy link
Copy Markdown

refactor(various): Add type hints to couple modules in cabotage.utils and cabotage.celery packages

build(redis): Major update from 7.4.0 to 8.0.1
build(typing): Add pyrefly and configure strict preset
build(typing): Add types-hvac
build(typing): Remove types-redis as redis v8 comes with better (but conflicting) type hints

Description

  • Hopefully, add more type hints if the maintainers are ok with the approach. This can be done as part of this PR (might end up huge) or in gradual PRs.
  • I didn't really have a plan when I started to add types, I just started with what I thought would be smaller modules 😅.
  • Some str types can be changed to Literal['whatever'] and vice-versa. I am not confident enough with the domain to make the call, for the most part I defaulted to str unless I was sure.
  • The type name themselves are open to bike shedding.
  • Added Pyrefly for the following reasons
    • offers a "strict" mode
    • imo, caught a (possible) bug that ty failed to catch. This is the only functional change made.
  • The current work can and should be revisited if merged as-is. There are some places where I ignored type errors. Just so I can cover more ground.

Reference to issue

Review request

Breaking changes

…s` and `cabotage.celery` packages

build(redis): Major update from 7.4.0 to 8.0.1
build(typing): Add `pyrefly` and configure strict preset
build(typing): Add `types-hvac`
build(typing): Remove `types-redis` as redis v8 comes with better (but conflicting) type hints
@Alc-Alc
Alc-Alc marked this pull request as draft July 13, 2026 17:10
@Alc-Alc

Alc-Alc commented Jul 13, 2026

Copy link
Copy Markdown
Author

For context, after adding Pyrefly (no other changes)
Initial: 7762 errors

As of this PR: 7421 errors

Reemphasizing that this is using the strictest mode it offers.

@Alc-Alc
Alc-Alc force-pushed the add-types branch 4 times, most recently from 69c63a8 to 63ea4da Compare August 3, 2026 19:21
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.

1 participant