Skip to content

services: add missing type annotations#1202

Merged
ryneeverett merged 3 commits intoGothenburgBitFactory:developfrom
Lotram:service-type-annotations
Apr 27, 2026
Merged

services: add missing type annotations#1202
ryneeverett merged 3 commits intoGothenburgBitFactory:developfrom
Lotram:service-type-annotations

Conversation

@Lotram
Copy link
Copy Markdown
Collaborator

@Lotram Lotram commented Apr 22, 2026

Add return type and argument annotations across all services to satisfy the ANN ruff rules, which are now enforced on the full bugwarrior/ package.

  • fixes a latent bug in NextcloudDeckService.get_owner, which treated a NextcloudDeckIssue as a subscriptable dict (TypeError at runtime when only_if_assigned was configured), and adds a regression test.
  • Remove Client inheritance from any Service subclass. Since this Client class only has a single staticmethod, and nothing else, we call Client.json_responses directly instead. Services that subclass Client already use it an attribute rather than a parent class, so this change adds consistency between all services
  • use explicit __init__ parameters for all Service subclasses (using config and main_config), as they are required anyway, for easier typing.
  • gitlab and github use type aliases, to improve readability

Add return type and argument annotations across all services to satisfy
the ANN ruff rules, which are now enforced on the full bugwarrior/
package.

Also fixes a latent bug in NextcloudDeckService.get_owner, which treated
a NextcloudDeckIssue as a subscriptable dict (TypeError at runtime when
only_if_assigned was configured), and adds a regression test.
Comment thread bugwarrior/services/teamwork_projects.py Outdated
Comment thread pyproject.toml Outdated
@Lotram Lotram force-pushed the service-type-annotations branch from 4d4abbe to e0eeb9a Compare April 27, 2026 07:07
@ryneeverett ryneeverett merged commit 4b3b502 into GothenburgBitFactory:develop Apr 27, 2026
8 checks passed
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