Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mypy/newsemanal/semanal_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from mypy.errors import Errors
from mypy.newsemanal.semanal_infer import infer_decorator_signature_if_simple
from mypy.checker import FineGrainedDeferredNode
import mypy.build

MYPY = False
if MYPY:
Expand Down Expand Up @@ -278,6 +279,9 @@ def semantic_analyze_target(target: str,
analyzer.refresh_partial(refresh_node, patches, final_iteration)
if isinstance(node, Decorator):
infer_decorator_signature_if_simple(node, analyzer)
for dep in analyzer.imports:
state.dependencies.append(dep)
state.priorities[dep] = mypy.build.PRI_LOW
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no checking against what is already a dependency, so can this result in things ending up in the dependency list multiple times or having the priority clobbered?
(Though I suppose we hope that the priority does not matter with the new semantic analyzer, right?)

if analyzer.deferred:
return [target], analyzer.incomplete, analyzer.progress
else:
Expand Down
15 changes: 15 additions & 0 deletions test-data/unit/check-newsemanal.test
Original file line number Diff line number Diff line change
Expand Up @@ -2020,3 +2020,18 @@ class C(Generic[T]): ...

class A: ...
class D: ...

[case testNewAnalyzerAddedSubStarImport_incremental]
# TODO: This can be removed once testAddedSubStarImport is enabled in check-incremental.test.
# cmd: mypy -m a pack pack.mod b
# cmd2: mypy -m other
[file a.py]
from pack import *
[file pack/__init__.py]
[file pack/mod.py]
[file b.py]
import pack.mod
[file other.py]
import a
[out]
[out2]