Skip to content

fix: resolve Pyright 'Import not found' errors for namespace packages#109

Open
ZiRoX7 wants to merge 1 commit intodatapizza-labs:mainfrom
ZiRoX7:fix/pyright-namespace-packages
Open

fix: resolve Pyright 'Import not found' errors for namespace packages#109
ZiRoX7 wants to merge 1 commit intodatapizza-labs:mainfrom
ZiRoX7:fix/pyright-namespace-packages

Conversation

@ZiRoX7
Copy link
Contributor

@ZiRoX7 ZiRoX7 commented Feb 2, 2026

Summary

  • Add __init__.py with extend_path to all namespace package directories
  • Add py.typed marker files for PEP 561 type checking support
  • Update pyrightconfig.json with extraPaths for monorepo development

Problem

When importing locally-built datapizza-ai clients in a new project, Pyright reports import resolution errors like "Import
'datapizza.clients.google' could not be resolved" despite correct installation.

Solution

This fixes IDE type checking errors when importing from distributed namespace packages (e.g., datapizza.clients.google) while
maintaining full runtime compatibility.

Closes #88

  - Add __init__.py with extend_path to all namespace package directories                                                                 - Add py.typed marker files for PEP 561 type checking support
  - Update pyrightconfig.json with extraPaths for monorepo development

  This fixes IDE type checking errors when importing from distributed
  namespace packages (e.g., datapizza.clients.google) while maintaining
  full runtime compatibility.

  Closes datapizza-labs#88
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.

Pyright warning/error "Import not found" when importing clients (built locally) in a new project

1 participant