fix: resolve Pyright 'Import not found' errors for namespace packages#109
Open
ZiRoX7 wants to merge 1 commit intodatapizza-labs:mainfrom
Open
fix: resolve Pyright 'Import not found' errors for namespace packages#109ZiRoX7 wants to merge 1 commit intodatapizza-labs:mainfrom
ZiRoX7 wants to merge 1 commit intodatapizza-labs:mainfrom
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__init__.pywithextend_pathto all namespace package directoriespy.typedmarker files for PEP 561 type checking supportpyrightconfig.jsonwithextraPathsfor monorepo developmentProblem
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) whilemaintaining full runtime compatibility.
Closes #88