Skip to content

types: reduce MyPy debt without changing runtime behavior - #5

Merged
Rimus0cod merged 21 commits into
mainfrom
fix/mypy-debt
Oct 5, 2026
Merged

Rimus0cod merged 21 commits into
mainfrom
fix/mypy-debt

Conversation

@Rimus0cod

@Rimus0cod Rimus0cod commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Goal

Eliminate the existing strict-MyPy debt without weakening type checking or hiding errors.

Result

  • MyPy errors reduced from 73 to 0
  • strict MyPy remains enabled
  • MyPy is blocking CI again (continue-on-error removed)
  • no blanket # type: ignore was added to hide failures
  • runtime/business behavior was intentionally preserved

Main fixes

  • added PyMySQL and PyYAML type stubs
  • narrowed dynamic Redis/JSON/YAML return values
  • typed optional Sentry, Google Speech, and Google TTS imports safely
  • fixed asyncio.gather(..., return_exceptions=True) result handling
  • normalized AmoCRM/Bitrix result types
  • fixed Google streaming recognition call typing
  • added a reusable typed HTML attribute helper for BeautifulSoup values
  • removed dozens of Tag.get() union-type errors without blanket casts
  • typed dynamic httpx client kwargs and scraper async results
  • applied official Ruff formatting to changed Python files

Final validation — CI run #31

  • Ruff: pass
  • Ruff format check: pass
  • MyPy (blocking): pass
  • TypeScript check: pass
  • Vite production build: pass
  • Docker image build: pass

The repository now has zero MyPy errors across app/ and integrations/ under the existing strict configuration.

@Rimus0cod
Rimus0cod merged commit e824708 into main Oct 5, 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.

1 participant