Skip to content

Fix Pyright reportMissingImports for sphinx_autodoc_typehints in docs conf.py files#84

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-pyright-missing-import
Open

Fix Pyright reportMissingImports for sphinx_autodoc_typehints in docs conf.py files#84
Copilot wants to merge 2 commits intomainfrom
copilot/fix-pyright-missing-import

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Summary

Pyright scans docs/ but the default poe install excludes the docs dependency group, causing reportMissingImports on the sphinx_autodoc_typehints import in both conf.py files in a fresh dev environment.

Added reportMissingImports to the existing # pyright: ignore inline suppression on the conditional import — the minimal, targeted fix:

# Before
import sphinx_autodoc_typehints  # noqa: F401  # pyright: ignore[reportUnusedImport]

# After
import sphinx_autodoc_typehints  # noqa: F401  # pyright: ignore[reportUnusedImport,reportMissingImports]

Applied to both:

  • docs/source/conf.py
  • agents/agent1/docs/source/conf.py

Testing

  • Not run (why?)
  • uv run poe check
  • Other: pyright agents/agent1/docs/source/conf.py docs/source/conf.py0 errors, 0 warnings, 0 informations

Checklist

  • Linked issue or task reference
  • Added/updated tests where relevant
  • Updated docs/README if needed
  • No secrets or sensitive data added
  • Considered backward compatibility and deployment impact

Additional context

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix Pyright failure: suppress missing-import for sphinx_autodoc_typehints in docs/source/conf.py</issue_title>
<issue_description>## Summary

agents/agent1/docs/source/conf.py is included in Pyright's scan (via [tool.pyright].include), but the docs dependency group is excluded from the default poe setup/install. This means Pyright will fail with a reportMissingImports error for sphinx_autodoc_typehints in a fresh dev environment unless the docs group is explicitly installed.

File / Line

  • File: agents/agent1/docs/source/conf.py
  • Line: 52

Original Review Comment

This file is type-checked by Pyright (docs are included), but later it conditionally imports sphinx_autodoc_typehints without a reportMissingImports suppression. Since the default poe setup/install excludes the docs dependency group, Pyright will commonly fail in a fresh dev env unless you either (a) add a Pyright missing-import ignore for that import, (b) exclude docs from Pyright, or (c) install the docs group by default.

Suggested Fix

Choose one of:

  • (a) Add a # type: ignore[import] (or # pyright: ignore[reportMissingImports]) comment on the sphinx_autodoc_typehints import line in conf.py.
  • (b) Exclude docs/ from Pyright's include list in pyproject.toml.
  • (c) Install the docs dependency group by default in the dev setup task.

Context

Related PR: #51
Review comment: #51 (comment)

Generated by PR Review Comment — Create Issue for issue #51

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@pmalarme pmalarme marked this pull request as ready for review February 19, 2026 22:15
Copilot AI review requested due to automatic review settings February 19, 2026 22:15
Copy link
Contributor

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.

Copilot wasn't able to review any files in this pull request.

….py files

Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Pyright failure: suppress missing-import for sphinx_autodoc_typehints Fix Pyright reportMissingImports for sphinx_autodoc_typehints in docs conf.py files Feb 19, 2026
Copilot AI requested a review from pmalarme February 19, 2026 22:26
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.

Fix Pyright failure: suppress missing-import for sphinx_autodoc_typehints in docs/source/conf.py

3 participants