Skip to content

refactor: convert to class-based DI architecture - #21

Merged
djachenko merged 6 commits into
masterfrom
refactor/26.07.29.di_architecture
Jul 28, 2026
Merged

refactor: convert to class-based DI architecture#21
djachenko merged 6 commits into
masterfrom
refactor/26.07.29.di_architecture

Conversation

@djachenko

Copy link
Copy Markdown
Owner

Summary

  • Setup, Auth, Drive converted to proper classes with dependencies injected via __init__
  • New App class as composition root — owns business logic for upload, login, logout
  • main.py reduced to thin Typer layer: parses args, delegates to _app = create_app()
  • Dependency graph: Config → Setup → Auth → Drive → App
  • Ruff upgraded to 0.16, new lint errors fixed, B008 ignore moved to pyproject.toml

Test plan

  • test_app.py — new, covers App logic via injected mocks (no patching needed)
  • test_main.py — Typer routing only: flags, command dispatch, default command
  • test_auth.py, test_drive.py — updated to use injected mocks instead of patch()
  • conftest.pydocx_file and drive fixtures; all file creation through create_files
  • 47 tests passing, ruff + mypy clean

@djachenko
djachenko force-pushed the refactor/26.07.29.di_architecture branch from 0cd6f99 to 7af8c44 Compare July 28, 2026 22:09
@djachenko
djachenko enabled auto-merge July 28, 2026 22:17
@djachenko
djachenko merged commit 6c1fee6 into master Jul 28, 2026
16 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