Skip to content

Conversation

@pt-anthropic
Copy link

When a py.typed package was added to check paths (e.g., via command line), reportPrivateImportUsage errors would incorrectly disappear. This happened because addTrackedFile() was creating source files with isInPyTypedPackage=false without detecting the actual py.typed status.

The fix detects py.typed status using _getModuleImportInfoForFile() when adding tracked files, similar to how setFileOpened() already does. This ensures that files from py.typed packages are correctly marked even when added directly to check paths.

Added test case that reproduces the bug scenario with three packages where pkg_b re-imports from pkg_a without re-exporting, and pkg_c imports from pkg_b.

@pt-anthropic pt-anthropic force-pushed the claude/fix-private-import-errors-QFgW4 branch 2 times, most recently from 1282409 to d904088 Compare January 18, 2026 06:40
@pt-anthropic
Copy link
Author

@microsoft-github-policy-service agree company="Anthropic"

@pt-anthropic
Copy link
Author

Is there anything more you need from me here?

…is tracked

When a py.typed package was added to check paths (e.g., via command line),
reportPrivateImportUsage errors would incorrectly disappear. This happened
because addTrackedFile() was creating source files with isInPyTypedPackage=false
without detecting the actual py.typed status.

The fix detects py.typed status using _getModuleImportInfoForFile() when adding
tracked files, similar to how setFileOpened() already does. This ensures that
files from py.typed packages are correctly marked even when added directly to
check paths.

Added test case that reproduces the bug scenario with three packages where pkg_b
re-imports from pkg_a without re-exporting, and pkg_c imports from pkg_b.
@pt-anthropic pt-anthropic force-pushed the claude/fix-private-import-errors-QFgW4 branch from d904088 to eaa2bad Compare January 25, 2026 17:31
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