Skip to content

Strict typing, more coverage, updated fmd public server#12

Merged
devinslick merged 3 commits into
mainfrom
ThoreFeedback
Nov 19, 2025
Merged

Strict typing, more coverage, updated fmd public server#12
devinslick merged 3 commits into
mainfrom
ThoreFeedback

Conversation

@devinslick
Copy link
Copy Markdown
Owner

chore: enforce strict typing and improve test coverage for v2.0.5

This release focuses on code quality, type safety, and test coverage improvements following the v2.0.4 feature release.

Strict Typing (Phase 1):

  • Enabled strict mypy configuration in pyproject.toml (disallow untyped defs, no implicit optional, etc.).
  • Fixed all type errors in fmd_api/client.py and fmd_api/device.py.
  • Added precise return types and generic type hints (e.g., List[Dict[str, Any]]) throughout the core library.
  • Created docs/strict_typing_enforcement_plan.md outlining the roadmap for type safety.

Test Coverage:

  • Increased overall test coverage to 99%.
  • Added tests/unit/test_deprecated.py to verify deprecated wrappers in Device class.
  • Added test cases for Location.from_json edge cases (missing dates, invalid inputs) in tests/unit/test_models.py.
  • Added validation tests for Device.lock() message truncation and sanitization.

Documentation:

  • Updated docs/mypy_baseline_errors.md to track progress (now resolved).
    chore: enforce strict typing and improve test coverage for v2.0.5

This release focuses on code quality, type safety, and test coverage improvements following the v2.0.4 feature release.

Strict Typing (Phase 1):

  • Enabled strict mypy configuration in pyproject.toml (disallow untyped defs, no implicit optional, etc.).
  • Fixed all type errors in fmd_api/client.py and fmd_api/device.py.
  • Added precise return types and generic type hints (e.g., List[Dict[str, Any]]) throughout the core library.
  • Created docs/strict_typing_enforcement_plan.md outlining the roadmap for type safety.

Test Coverage:

  • Increased overall test coverage to 99%.
  • Added tests/unit/test_deprecated.py to verify deprecated wrappers in Device class.
  • Added test cases for Location.from_json edge cases (missing dates, invalid inputs) in tests/unit/test_models.py.
  • Added validation tests for Device.lock() message truncation and sanitization.

Documentation:

  • Updated docs/mypy_baseline_errors.md to track progress (now resolved).

devinslick and others added 3 commits November 16, 2025 13:19
This release focuses on code quality, type safety, and test coverage improvements following the v2.0.4 feature release.

Strict Typing (Phase 1):
- Enabled strict mypy configuration in pyproject.toml (disallow untyped defs, no implicit optional, etc.).
- Fixed all type errors in md_api/client.py and md_api/device.py.
- Added precise return types and generic type hints (e.g., List[Dict[str, Any]]) throughout the core library.
- Created docs/strict_typing_enforcement_plan.md outlining the roadmap for type safety.

Test Coverage:
- Increased overall test coverage to 99%.
- Added 	ests/unit/test_deprecated.py to verify deprecated wrappers in Device class.
- Added test cases for Location.from_json edge cases (missing dates, invalid inputs) in 	ests/unit/test_models.py.
- Added validation tests for Device.lock() message truncation and sanitization.

Documentation:
- Updated docs/mypy_baseline_errors.md to track progress (now resolved).
chore: enforce strict typing and improve test coverage for v2.0.5

This release focuses on code quality, type safety, and test coverage improvements following the v2.0.4 feature release.

Strict Typing (Phase 1):
- Enabled strict mypy configuration in pyproject.toml (disallow untyped defs, no implicit optional, etc.).
- Fixed all type errors in md_api/client.py and md_api/device.py.
- Added precise return types and generic type hints (e.g., List[Dict[str, Any]]) throughout the core library.
- Created docs/strict_typing_enforcement_plan.md outlining the roadmap for type safety.

Test Coverage:
- Increased overall test coverage to 99%.
- Added 	ests/unit/test_deprecated.py to verify deprecated wrappers in Device class.
- Added test cases for Location.from_json edge cases (missing dates, invalid inputs) in 	ests/unit/test_models.py.
- Added validation tests for Device.lock() message truncation and sanitization.

Documentation:
- Updated docs/mypy_baseline_errors.md to track progress (now resolved).
Copilot AI review requested due to automatic review settings November 19, 2025 02:16
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enforces strict typing and improves test coverage as part of the v2.0.5 release, focusing on code quality and type safety improvements.

Key Changes

  • Enabled strict mypy configuration with comprehensive type checking rules
  • Added type hints throughout core modules (fmd_api/client.py, fmd_api/device.py) and test files
  • Increased test coverage to 99% with new tests for deprecated methods, lock message validation, and edge cases
  • Updated FMD public server URL to the official community instance

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Version bump to 2.0.5 and strict mypy configuration added
fmd_api/client.py Added return type annotations, type hints for variables, and typed __aexit__ parameters
fmd_api/device.py Added return type annotations and type parameters for generic Dict types
tests/unit/test_models.py Added type hints and new test for Location.from_json with missing date field
tests/unit/test_lock_message.py Added test for long message truncation validation
tests/unit/test_deprecated.py New test file covering all deprecated Device wrapper methods
fmd_api/_version.py Version string updated to 2.0.5
docs/strict_typing_enforcement_plan.md New documentation outlining typing roadmap
docs/mypy_baseline_errors.md New documentation tracking resolved mypy errors
docs/release/v2.0.4.md New release notes for v2.0.4
README.md Updated public server URL to official community instance
.pre-commit-config.yaml Added strict mode flags to mypy pre-commit hook
.coverage SQLite coverage database file (should not be committed)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread fmd_api/client.py
async def __aexit__(self, exc_type, exc, tb) -> None:
async def __aexit__(
self,
exc_type: Optional[type[BaseException]],
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type annotation type[BaseException] uses Python 3.10+ syntax. Since this project supports Python 3.8+ (per requires-python = ">=3.8" in pyproject.toml), this will cause a TypeError at import time in Python 3.8 and 3.9.

For compatibility, you should use Optional[Type[BaseException]] and import Type from typing:

from typing import Optional, Type
...
async def __aexit__(
    self,
    exc_type: Optional[Type[BaseException]],
    exc: Optional[BaseException],
    tb: Optional[TracebackType],
) -> None:

Copilot uses AI. Check for mistakes.
@devinslick devinslick merged commit 3335c46 into main Nov 19, 2025
28 checks passed
@devinslick devinslick deleted the ThoreFeedback branch November 19, 2025 02:48
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.

3 participants