-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
astral-sh/ruff
#22851Labels
importsModule resolution, site-packages discovery, import-related diagnosticsModule resolution, site-packages discovery, import-related diagnosticsquestionAsking for support or clarificationAsking for support or clarification
Description
Summary
Here's the project topology:
myproject/
├─ src/
│ ├─ __init__.py
│ ├─ utils.py
│ └─ something.py
├─ tests/
└─ pyproject.toml
with something.py importing like from .utils import utilityfunc.
ty doesn't like that at all. debugging gives:
2025-10-19T18:52:58.723460Z DEBUG ty_python_semantic::types::infer::builder: Relative module resolution `.utils` failed: too many leading dots
at crates/ty_python_semantic/src/types/infer/builder.rs:5010 on ThreadId(2)
in ty_project::check_file with file=file(Id(c00))
in ty_project::Project::check
So i guess ty finds the src directory and thinks it's gone one time up too many.
Is there any way to support this project layout ?
(of course creating a subdir src/myproject or renaming src to myproject "fixes" the issue)
Version
ty 0.0.1-alpha.23 (5c51b84 2025-10-16)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
importsModule resolution, site-packages discovery, import-related diagnosticsModule resolution, site-packages discovery, import-related diagnosticsquestionAsking for support or clarificationAsking for support or clarification