Skip to content

Add py.typed marker and return type annotations to l402_client.py#19

Closed
mac-agent wants to merge 1 commit intoBortlesboat:mainfrom
mac-agent:fix/issue-11-type-hints
Closed

Add py.typed marker and return type annotations to l402_client.py#19
mac-agent wants to merge 1 commit intoBortlesboat:mainfrom
mac-agent:fix/issue-11-type-hints

Conversation

@mac-agent
Copy link
Copy Markdown

Summary

Fixes #11

This PR adds the PEP 561 py.typed marker and completes return type annotations in l402_client.py.

Changes

  1. Created src/bitcoin_mcp/py.typed — empty PEP 561 marker file so type checkers (mypy, pyright) recognize the package as typed.

  2. Added return type annotations to l402_client.py:

    • L402Client.close()None
    • L402Client.__enter__()Self
    • L402Client.__exit__()None (also added proper parameter types)
    • L402PaymentRequired.__init__()None
    • L402PriceTooHigh.__init__()None
  3. Added from __future__ import annotations and Self import from typing.

Testing

  • Type annotation changes only, no behavioral changes
  • py.typed file is included in the package via hatchling's default behavior (packages under src/bitcoin_mcp/)

Acceptance Criteria

  • src/bitcoin_mcp/py.typed exists (empty file)
  • All functions in l402_client.py have complete type annotations
  • Package still installs correctly with pip install -e .

- Created src/bitcoin_mcp/py.typed (PEP 561 marker)
- Added return types to L402Client.close() -> None, __enter__() -> Self, __exit__() -> None
- Added return types to L402PaymentRequired.__init__() -> None, L402PriceTooHigh.__init__() -> None
- Added 'from __future__ import annotations' and Self import

Fixes Bortlesboat#11
@Bortlesboat
Copy link
Copy Markdown
Owner

Closing this as superseded by #31, which consolidates the open backlog work into one maintainer sweep. Thank you for the contribution and the concrete issue coverage here.

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.

Add py.typed marker and improve type hints in l402_client.py

2 participants