Summary
Hi,
I've noticed a regression in ruff analyze graph.
In a PEP-420 namespace package, imports from stdlib are resolved to sibling modules (when these exist).
Concretely here's a MWE:
# pyproject.toml
[tool.ruff]
src = ["src"]
namespace-packages = ["src/example"]
# src/example/main.py
from typing import Any
x: Any = 1
# src/example/typing.py
y = 3
Results:
% uvx ruff@0.14.9 analyze graph
warning: `ruff analyze graph` is experimental and may change without warning
{
"src/example/main.py": [],
"src/example/typing.py": []
}
% uvx ruff@0.14.10 analyze graph
warning: `ruff analyze graph` is experimental and may change without warning
{
"src/example/main.py": [
"src/example/typing.py"
],
"src/example/typing.py": []
}
(same behavior in 0.14.10 and 0.16.5)
This might be related to #21817, which makes sense given that adding an empty __init__.pyi fixes it.
What do you think?
Thanks!
Version
0.16.5
Summary
Hi,
I've noticed a regression in
ruff analyze graph.In a PEP-420 namespace package, imports from stdlib are resolved to sibling modules (when these exist).
Concretely here's a MWE:
Results:
(same behavior in 0.14.10 and 0.16.5)
This might be related to #21817, which makes sense given that adding an empty
__init__.pyifixes it.What do you think?
Thanks!
Version
0.16.5