Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "files to analyze" notification hanging on typeshed stubs when they aren't actually being analyzed #978

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

DetachHead
Copy link
Owner

@DetachHead DetachHead commented Jan 5, 2025

as far as i can tell this is an upstream bug that was uncovered by #932

fixes #967

…yze when they aren't actually being analyzed, which caused a "files to analyze" notification to hang forever on files that never get analyzed
@DetachHead DetachHead marked this pull request as ready for review January 5, 2025 07:03
@DetachHead DetachHead changed the title fix non-user code (eg. typeshed stubs) being counted as files to analyze when they aren't actually being analyzed fix "files to analyze" notification hanging on typeshed stubs when they aren't actually being analyzed Jan 5, 2025
Copy link
Contributor

github-actions bot commented Jan 5, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

sympy (https://github.com/sympy/sympy)
-     Type of "n" is "Unknown | ((n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr) | Any" (reportUnknownMemberType)
+     Type of "n" is "Unknown | ((n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr)" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:479:5 - warning: Type of "sol" is partially unknown
+     Type of "sol" is "dict[Any, ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:501:5 - warning: Type of "eqs" is partially unknown
+     Type of "eqs" is "list[Unknown]" (reportUnknownVariableType)
-     Argument type is "Unknown | Any | _NotImplementedType" (reportUnknownArgumentType)
+     Argument type is "Unknown | _NotImplementedType" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:717:18 - warning: Argument type is unknown
+     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
-     Argument type is "Equality | Unknown" (reportUnknownArgumentType)
+     Argument type is "Equality | Unknown | Relational | Unequality" (reportUnknownArgumentType)
-     Type of "eq" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "eq" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1385:13 - warning: Argument type is Any
-     Argument corresponds to parameter "lhs" in function "__new__" (reportAny)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1563:5 - warning: Type of "answer" is partially unknown
+     Type of "answer" is "list[dict[Any, int] | dict[Any, int | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown]]" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1737:33 - warning: Argument type is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1737:33 - warning: Argument type is unknown
-     Argument corresponds to parameter "iterable" in function "__init__"
+     Argument corresponds to parameter "iterable" in function "__init__" (reportUnknownArgumentType)
-     Argument type is "list[Unknown] | list[list[Unknown]] | list[tuple[Unknown, int]]" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1768:5 - warning: Type of "eqs" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1768:5 - warning: Type of "eqs" is unknown (reportUnknownVariableType)
-     Type of "eqs" is "Unknown | Any" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1769:18 - warning: Argument type is unknown
+     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1770:18 - warning: Argument type is unknown
+     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
-     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic | Add | Expr | Mul | Dict, bool] | Basic | Add | Expr | Mul | Dict)" (reportUnknownMemberType)
+     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic, bool] | Basic | Expr)" (reportUnknownMemberType)
-     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic | Add | Expr | Mul | Dict, bool] | Basic | Add | Expr | Mul | Dict)" (reportUnknownMemberType)
+     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic, bool] | Basic | Expr)" (reportUnknownMemberType)
-     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic | Add | Expr | Mul | Dict, bool] | Basic | Add | Expr | Mul | Dict)" (reportUnknownMemberType)
+     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic, bool] | Basic | Expr)" (reportUnknownMemberType)
-     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic | Add | Expr | Mul | Dict, bool] | Basic | Add | Expr | Mul | Dict)" (reportUnknownMemberType)
+     Type of "det" is "(method: str = "bareiss", iszerofunc: Unknown | None = None) -> (Unknown | tuple[Unknown | Basic, bool] | Basic | Expr)" (reportUnknownMemberType)
-     Type of "eq1" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "eq1" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "eq2" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "eq2" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "eq3" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "eq3" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "eq1" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "eq1" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "eq2" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "eq2" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2498:23 - warning: Argument type is Any
-     Argument corresponds to parameter "args" in function "__new__" (reportAny)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2507:5 - warning: Type of "eq" is Any (reportAny)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2507:5 - warning: Type of "eq" is partially unknown
+     Type of "eq" is "Any | Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2508:18 - warning: Argument type is Any
-     Argument corresponds to parameter "eq" in function "unrad" (reportAny)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2536:5 - warning: Type of "t" is partially unknown
+     Type of "t" is "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2551:5 - warning: Type of "a" is partially unknown
+     Type of "a" is "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:2552:5 - warning: Type of "b" is partially unknown
+     Type of "b" is "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown" (reportUnknownVariableType)
-     Type of "e" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "e" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "n" is "Unknown | ((n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr) | Any" (reportUnknownMemberType)
+     Type of "n" is "Unknown | ((n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr)" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:506:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "args" in function "__new__" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:706:26 - warning: Argument type is Any
-     Argument corresponds to parameter "f" in function "solveset_real" (reportAny)
-     Type of "expr1" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "expr1" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "expr2" is "Equality | Unknown" (reportUnknownVariableType)
+     Type of "expr2" is "Equality | Unknown | Relational | Unequality" (reportUnknownVariableType)
-     Type of "eqns2" is "list[Equality | Unknown | Any]" (reportUnknownVariableType)
+     Type of "eqns2" is "list[Equality | Unknown | Relational | Unequality | Any]" (reportUnknownVariableType)
-     Type of "number" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr" (reportUnknownVariableType)
+     Type of "number" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Expr" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:2793:21 - warning: Argument type is Any
-     Argument corresponds to parameter "f" in function "solveset" (reportAny)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:3411:13 - warning: Argument type is Any
-     Argument corresponds to parameter "lhs" in function "__new__" (reportAny)
-     Type of "eq1" is "list[Equality | Unknown]" (reportUnknownVariableType)
+     Type of "eq1" is "list[Equality | Unknown | Relational | Unequality]" (reportUnknownVariableType)
-     Type of "eq2" is "list[Equality | Unknown]" (reportUnknownVariableType)

... (truncated 4087 lines) ...

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/duplicates.test/packages/virtual-build/package.py:15:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/duplicates.test/packages/virtual-build/package.py:15:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/blas-only-client/package.py:18:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/blas-only-client/package.py:18:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/conditional-edge/package.py:21:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/conditional-edge/package.py:22:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/conditional-edge/package.py:23:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/conditional-edge/package.py:21:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/conditional-edge/package.py:22:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/edges.test/packages/conditional-edge/package.py:23:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:10:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:10:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:12:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:12:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/t/package.py:14:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:10:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:10:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:12:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:12:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:13:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:13:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:14:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:15:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:15:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:17:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:17:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:12:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:12:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)

... (truncated 63 lines) ...

@DetachHead DetachHead merged commit 97ddbd6 into main Jan 5, 2025
20 checks passed
@DetachHead DetachHead deleted the fix-files-to-analyze-count branch January 5, 2025 07:47
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.

Forever in progress analyzing typeshed files after version 1.23.0
1 participant