Skip to content

fix(bench-tools): 🏷️ ship a py.typed marker - #245

Merged
robertodr merged 1 commit into
mainfrom
fix/bench-tools-py-typed
Aug 19, 2026
Merged

fix(bench-tools): 🏷️ ship a py.typed marker#245
robertodr merged 1 commit into
mainfrom
fix/bench-tools-py-typed

Conversation

@Panadestein

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Follow-up to #227.

The diagnosis (confirmed)

monoprop_bench_tools declares the Typing :: Typed classifier and is fully annotated, but it shipped no PEP 561 py.typed marker. Since it resolves as an installed library (its source tree lives under packages/, outside the [tool.pyright] include set), pyright/Pylance treat it as untyped and emit reportMissingTypeStubs on every import in benches/conftest.py.

monoprop itself is unaffected because nanobind's stubgen already generates a marker (src/monoprop/bindings/CMakeLists.txt, MARKER_FILE).

Reproduced and verified with pyright 1.1.408 against the workspace environment:

Before:

benches/conftest.py:44:6 - warning: Stub file not found for "monoprop_bench_tools.memory.cpu" (reportMissingTypeStubs)
benches/conftest.py:50:6 - warning: Stub file not found for "monoprop_bench_tools.models" (reportMissingTypeStubs)
benches/conftest.py:62:10 - warning: Stub file not found for "monoprop_bench_tools.models" (reportMissingTypeStubs)

After: 0 warnings.

The change

One empty file: packages/monoprop-bench-tools/src/monoprop_bench_tools/py.typed.

Also verified the marker actually reaches consumers of the published distribution — uv build --package monoprop-bench-tools --wheel produces a wheel containing monoprop_bench_tools/py.typed, so hatchling picks it up without any extra [tool.hatch.build] include rule.

monoprop_bench_tools declares the "Typing :: Typed" classifier and is fully
annotated, but shipped no PEP 561 marker. Consumers resolve it as an installed
library (it is outside the pyright `include` set), so type checkers treated it
as untyped and Pylance reported `reportMissingTypeStubs` on every import in
benches/conftest.py. monoprop itself already gets a marker from nanobind's
stubgen; this gives the sibling distribution the same.

Assisted-by: GitHubCopilot:claude-opus-4.5
@github-actions

Copy link
Copy Markdown

Docs preview: https://pr-245.monoprop-docs.pages.dev

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.70%. Comparing base (1b7533f) to head (c70623c).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #245   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files          14       14           
  Lines         742      742           
  Branches       98       98           
=======================================
  Hits          725      725           
  Misses         12       12           
  Partials        5        5           
Flag Coverage Δ
cpp 97.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@robertodr
robertodr enabled auto-merge (squash) August 19, 2026 10:55
@sonarqubecloud

Copy link
Copy Markdown

@robertodr
robertodr merged commit 16b4b99 into main Aug 19, 2026
24 checks passed
@robertodr
robertodr deleted the fix/bench-tools-py-typed branch August 19, 2026 11:59
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.

2 participants