Skip to content

Follow imports from folders the project puts on the import path - #40

Merged
utkarsh5026 merged 2 commits into
mainfrom
ccr-1d174def-g2juq1
Oct 21, 2026
Merged

utkarsh5026 merged 2 commits into
mainfrom
ccr-1d174def-g2juq1

Conversation

@utkarsh5026

Copy link
Copy Markdown
Owner

pyright's and Pylance's extraPaths (pyproject.toml, pyrightconfig.json,
.vscode/settings.json) and pytest's pythonpath are read as sys.path
entries, so from common.db import save finds src/common/db.py from a
file however deep, instead of being read as an installed library.
--path DIR adds a folder no setting names.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_016fHMijQnuPHAMZKreyaHqQ

pyright's and Pylance's extraPaths (pyproject.toml, pyrightconfig.json,
.vscode/settings.json) and pytest's pythonpath are read as sys.path
entries, so `from common.db import save` finds src/common/db.py from a
file however deep, instead of being read as an installed library.
--path DIR adds a folder no setting names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016fHMijQnuPHAMZKreyaHqQ
Besides pyright's extraPaths and pytest's pythonpath: mypy's mypy_path,
setuptools' packages.find where and package-dir, and Poetry's packages
from. A pyproject.toml in a subfolder counts from its own folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016fHMijQnuPHAMZKreyaHqQ

@utkarsh5026 utkarsh5026 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@utkarsh5026
utkarsh5026 merged commit ac1ddf7 into main Oct 21, 2026
8 checks passed
@utkarsh5026
utkarsh5026 deleted the ccr-1d174def-g2juq1 branch October 21, 2026 15:23
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