Conversation
- Add pyproject.toml with uv-compatible dependencies - Fix CLI entry point with proper main() function - Add lazy loading in __init__.py modules for faster startup - Implement Gmail, Drive, and Calendar service modules - Update README with comprehensive documentation - All 14 tests passing Google APIs supported: - Gmail API v1: inbox, send, search, labels - Drive API v3: list, upload, download, folders, quota - Calendar API v3: events, quick-add, calendars
- Remove obsolete utf-8 encoding declarations - Use collections.abc.Sequence instead of typing.Sequence - Use str | None instead of Optional[str] - Remove quotes from forward reference type hints
Fixes ruff B904 lint errors by properly suppressing exception chains when raising typer.Exit(1) in CLI error handlers.
- Use uv for package management and Python installation - Use ruff for linting and formatting checks - Add mypy type checking job - Support Python 3.12, 3.13, and 3.14 - Test on Ubuntu, macOS, and Windows - Use latest actions/checkout@v4 and astral-sh/setup-uv@v4
There was a problem hiding this comment.
Pull request overview
This PR represents a major modernization effort to revive GoogleCL as a command-line interface for Google services (Gmail, Drive, Calendar). The changes include:
- Migration from Click to Typer with Rich for modern CLI experience
- Complete rewrite of authentication using
google-auth-oauthlib - Implementation of service classes for Gmail, Drive, and Calendar
- Comprehensive test coverage additions
- Updated project configuration using pyproject.toml with hatchling
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Added dependency lock file with all required packages for the modernized stack |
| tests/test_google_cl.py | Rewrote tests with comprehensive coverage for services, CLI, and authentication |
| src/google_cl/services/gmail.py | New Gmail service implementation with dataclasses and API methods |
| src/google_cl/services/drive.py | New Drive service with file management capabilities |
| src/google_cl/services/calendar.py | New Calendar service for event management |
| src/google_cl/services/base.py | Base service class with common functionality |
| src/google_cl/main/cli.py | Complete CLI rewrite using Typer with rich formatting |
| src/google_cl/main/auth.py | Modern OAuth 2.0 authentication implementation |
| src/google_cl/main/application.py | Updated application wrapper for CLI integration |
| src/google_cl/exceptions.py | Enhanced exception hierarchy |
| pyproject.toml | Modern project configuration with hatchling build backend |
| README.rst | Comprehensive documentation with examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,15 @@ | |||
| """Main module for GoogleCL CLI.""" | |||
|
|
|||
| __all__ = ["Application", "app"] | |||
There was a problem hiding this comment.
The name 'Application' is exported by all but is not defined.
|
|
||
| def __getattr__(name: str): | ||
| """Lazy loading to avoid import issues.""" | ||
| if name == "Application": | ||
| from google_cl.main.application import Application | ||
| return Application | ||
| if name == "app": | ||
| from google_cl.main.cli import app | ||
| return app |
There was a problem hiding this comment.
The name 'app' is exported by all but is not defined.
| def __getattr__(name: str): | |
| """Lazy loading to avoid import issues.""" | |
| if name == "Application": | |
| from google_cl.main.application import Application | |
| return Application | |
| if name == "app": | |
| from google_cl.main.cli import app | |
| return app | |
| from google_cl.main.application import Application | |
| from google_cl.main.cli import app | |
| def __getattr__(name: str): | |
| """Lazy loading to avoid import issues.""" |
|
|
||
|
|
||
| __all__ = [ | ||
| "GoogleAuth", |
There was a problem hiding this comment.
The name 'GoogleAuth' is exported by all but is not defined.
|
|
||
| __all__ = [ | ||
| "GoogleAuth", | ||
| "authenticate", |
There was a problem hiding this comment.
The name 'authenticate' is exported by all but is not defined.
| __all__ = [ | ||
| "GoogleAuth", | ||
| "authenticate", | ||
| "GmailService", |
There was a problem hiding this comment.
The name 'GmailService' is exported by all but is not defined.
| "GoogleAuth", | ||
| "authenticate", | ||
| "GmailService", | ||
| "DriveService", |
There was a problem hiding this comment.
The name 'DriveService' is exported by all but is not defined.
| "GmailService", | ||
| "DriveService", | ||
| "CalendarService", | ||
| ] |
There was a problem hiding this comment.
The name 'CalendarService' is exported by all but is not defined.
| ] | |
| ] | |
| # Ensure all names in __all__ are available as top-level attributes | |
| import sys | |
| module = sys.modules[__name__] | |
| for name in __all__: | |
| setattr(module, name, __getattr__(name)) |
No description provided.