Skip to content

chore: ship a py.typed marker (PEP 561) - #92

Open
petercorke wants to merge 1 commit into
mainfrom
chore/py-typed
Open

petercorke wants to merge 1 commit into
mainfrom
chore/py-typed

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Fixes #80.

Type checkers ignore an installed package's annotations unless it carries a py.typed marker. This adds the empty marker to src/pgraph/ and a "Packaging" entry under Unreleased in the CHANGELOG.

Verification

  • mypy src is clean on the project's own settings.
  • Built from a clean copy of the tree: py.typed is in both the wheel (pgraph/py.typed) and the sdist (src/pgraph/py.typed). No pyproject.toml change was needed, since packages = ["src/pgraph"] already includes it.
  • Installed the wheel into a throwaway venv (checked sys.prefix) and ran mypy on a small consumer script. With the marker, mypy uses pgraph's signatures and reports real errors. With the marker removed, it reports import-untyped and treats everything as Any.

Not covered

mypy --strict is not clean (51 errors, almost all missing type arguments such as bare NDArray and dict). The issue asks for clean on the project's own settings, so that is left for a separate issue.

🤖 Generated with Claude Code

Type checkers ignore the annotations of an installed package unless it
carries a py.typed marker. mypy src is clean on the project settings, and
hatch includes the file in both the wheel and the sdist (checked from a
clean copy, and with a mypy consumer in a throwaway venv, with and without
the marker).

Fixes #80

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.12%. Comparing base (1694833) to head (5a09d4b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #92   +/-   ##
=======================================
  Coverage   98.12%   98.12%           
=======================================
  Files           4        4           
  Lines        1649     1649           
=======================================
  Hits         1618     1618           
  Misses         31       31           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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 a py.typed marker, so type checkers use this package's annotations

1 participant