-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Thank you for working on pylyzer. It's great to have a faster alternative to pytype, which is unbearably slow in large codebases.
We are exploring switching from pytype to pylyzer , but right now pylyzder doesn't support PEP518-configured python pakcages.
More specifically, running
> pylyzer
inside a package set up with pyprojec.toml and without setup.py doesn't analyze the whole package, only a single __init__.py file. This is important, because PEP518 is the way uv sets up packages by default and uv is becoming very popular.
Reproducible Code
mkdir pylyzer_bug
cd pylyzer_bug
uv init --package --build-backend setuptools
cat > src/pylyzer_bug/main.py << 'EOF'
def add(x: int, y: str) -> float:
return x + y
EOF
source .venv/bin/activate
pylyzer
Environment
OS: Ubuntu 22.04
Expected behavior
Calling pylyzer in package root analyzes all python package inside the package.
Error log
(pylyzer-bug) ~/D/pylyzer_bug ❯❯❯ pylyzer main ◼
Start checking: __init__.py
All checks OK: __init__.py
but it should error out like this:
(pylyzer-bug) ~/D/pylyzer_bug ❯❯❯ pylyzer src/pylyzer_bug/main.py main ◼
Start checking: main.py
Found 1 errors: main.py
Error[#2604]: File src/pylyzer_bug/main.py, line 3, <module>.add
3 | return x + y
: -
: |- expected: Int
: `- but found: Str
TypeError: the type of `+`::rhs (the 2nd argument) is mismatched
Screenshots
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working