Repository navigation
Fallback to root pyproject.toml if project pyproject.toml doesnt contain [tool.pyright] - #11323
Merged
Rich Chiodo (rchiodo) merged 6 commits intoMar 11, 2026
Merged
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- .../projects/sympy/sympy/solvers/tests/test_solveset.py:445:30 - error: Cannot access attribute "limit_denominator" for class "NaN"
- Attribute "limit_denominator" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/solvers/tests/test_solveset.py:445:30 - error: Cannot access attribute "limit_denominator" for class "ComplexInfinity"
- Attribute "limit_denominator" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/solvers/tests/test_solveset.py:620:16 - error: No overloads for "__new__" match the provided arguments (reportCallIssue)
+ .../projects/sympy/sympy/solvers/tests/test_solveset.py:620:19 - error: Argument of type "Expr | Unknown | float" cannot be assigned to parameter "arg" of type "Expr" in function "__new__"
+ Type "Expr | Unknown | float" is not assignable to type "Expr"
+ "float" is not assignable to "Expr" (reportArgumentType)
+ .../projects/sympy/sympy/solvers/tests/test_solveset.py:625:16 - error: No overloads for "__new__" match the provided arguments (reportCallIssue)
+ .../projects/sympy/sympy/solvers/tests/test_solveset.py:625:19 - error: Argument of type "Expr | Unknown | float" cannot be assigned to parameter "arg" of type "Expr" in function "__new__"
+ Type "Expr | Unknown | float" is not assignable to type "Expr"
+ "float" is not assignable to "Expr" (reportArgumentType)
- .../projects/sympy/sympy/stats/crv_types.py:2543:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
- Return type mismatch: base method returns type "None", override returns type "ComplexInfinity | NaN | Rational | Unknown"
- Type "ComplexInfinity | NaN | Rational | Unknown" is not assignable to type "None"
- "ComplexInfinity" is not assignable to "None" (reportIncompatibleMethodOverride)
- .../projects/sympy/sympy/stats/crv_types.py:2722:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
- Return type mismatch: base method returns type "None", override returns type "Expr | NaN | ComplexInfinity | Rational | Unknown"
- Type "Expr | NaN | ComplexInfinity | Rational | Unknown" is not assignable to type "None"
- "Expr" is not assignable to "None" (reportIncompatibleMethodOverride)
- .../projects/sympy/sympy/stats/frv_types.py:139:17 - error: Argument of type "NaN | ComplexInfinity | Rational | Unknown | Expr" cannot be assigned to parameter "value" of type "int" in function "__setitem__"
- Type "NaN | ComplexInfinity | Rational | Unknown | Expr" is not assignable to type "int"
- "Expr" is not assignable to "int" (reportArgumentType)
- .../projects/sympy/sympy/stats/joint_rv_types.py:576:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
+ .../projects/sympy/sympy/stats/joint_rv_types.py:576:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
- Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
+ Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
- .../projects/sympy/sympy/stats/rv_interface.py:451:42 - error: Operator "-" not supported for types "Unknown | Basic | Any" and "Rational | NaN | ComplexInfinity"
+ .../projects/sympy/sympy/stats/rv_interface.py:451:42 - error: Operator "-" not supported for types "Unknown | Basic | Any" and "Rational | Unknown"
- Operator "-" not supported for types "Basic" and "Rational"
- Operator "-" not supported for types "Basic" and "NaN"
- Operator "-" not supported for types "Basic" and "ComplexInfinity" (reportOperatorIssue)
+ Operator "-" not supported for types "Basic" and "Rational" (reportOperatorIssue)
- .../projects/sympy/sympy/stats/tests/test_finite_rv.py:35:23 - error: Operator "/" not supported for types "Unknown | Any | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | MatMul | tuple[Unknown, ...] | Infinity | NegativeInfinity | int" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | ZeroMatrix | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0]"
+ .../projects/sympy/sympy/stats/tests/test_finite_rv.py:35:23 - error: Operator "/" not supported for types "Unknown | Any | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | MatMul | Infinity | NegativeInfinity | Float | NotImplementedType | tuple[Unknown, ...] | int" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | ZeroMatrix | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0]"
- .../projects/sympy/sympy/stats/tests/test_finite_rv.py:247:19 - error: Argument of type "Rational | NaN | ComplexInfinity" cannot be assigned to parameter "p" of type "Half" in function "Coin"
+ .../projects/sympy/sympy/stats/tests/test_finite_rv.py:247:19 - error: Argument of type "Rational | Unknown" cannot be assigned to parameter "p" of type "Half" in function "Coin"
- Type "Rational | NaN | ComplexInfinity" is not assignable to type "Half"
+ Type "Rational | Unknown" is not assignable to type "Half"
- "ComplexInfinity" is not assignable to "Half" (reportArgumentType)
+ "Rational" is not assignable to "Half" (reportArgumentType)
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:402:32 - error: Cannot access attribute "shape" for class "Infinity"
+ Attribute "shape" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:402:32 - error: Cannot access attribute "shape" for class "NegativeInfinity"
+ Attribute "shape" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:402:32 - error: Cannot access attribute "shape" for class "Float"
+ Attribute "shape" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:428:25 - error: Cannot access attribute "shape" for class "Infinity"
+ Attribute "shape" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:428:25 - error: Cannot access attribute "shape" for class "NegativeInfinity"
+ Attribute "shape" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:428:25 - error: Cannot access attribute "shape" for class "Float"
+ Attribute "shape" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:438:31 - error: Operator "*" not supported for types "Zero | ZeroArray | Unknown | ArrayContraction | Basic | PermuteDims | Any | Transpose | One | NegativeOne | Integer | NaN | ComplexInfinity | Rational | Expr | MatMul" and "Zero | ZeroArray | Unknown | ArrayContraction | Basic | PermuteDims | Any | Transpose | MatrixExpr"
+ .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:438:31 - error: Operator "*" not supported for types "Zero | ZeroArray | Unknown | ArrayContraction | Basic | PermuteDims | Any | Transpose | One | NegativeOne | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | MatMul" and "Zero | ZeroArray | Unknown | ArrayContraction | Basic | PermuteDims | Any | Transpose | MatrixExpr"
- Return type mismatch: base method returns type "AssocOp", override returns type "Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | TensExpr | TensMul"
+ Return type mismatch: base method returns type "AssocOp", override returns type "One | Zero | TensExpr | TensMul"
- Type "Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | TensExpr | TensMul" is not assignable to type "AssocOp"
+ Type "One | Zero | TensExpr | TensMul" is not assignable to type "AssocOp"
- "ComplexInfinity" is not assignable to "AssocOp" (reportIncompatibleMethodOverride)
+ "One" is not assignable to "AssocOp" (reportIncompatibleMethodOverride)
- .../projects/sympy/sympy/tensor/tensor.py:3639:37 - error: Operator "*" not supported for types "Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational" and "Unknown | Basic"
- Operator "*" not supported for types "ComplexInfinity" and "Basic" when expected type is "Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational" (reportOperatorIssue)
- .../projects/sympy/sympy/tensor/tensor.py:4358:42 - error: Operator "*" not supported for types "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown" and "Basic | Unknown"
- Operator "*" not supported for types "ComplexInfinity" and "Basic" when expected type is "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown" (reportOperatorIssue)
- .../projects/sympy/sympy/tensor/tensor.py:4409:39 - error: Cannot access attribute "_matches" for class "NegativeOne"
- Attribute "_matches" is unknown (reportAttributeAccessIssue)
... (truncated 988 lines) ...
|
Rich Chiodo (rchiodo)
approved these changes
Mar 11, 2026
Contributor
Author
|
I absolutely hate to be a bother, but I'd love to know if there's a release cadence or some ETA on the next Pyright release, so I can work on the upgrade locally. Thanks! |
Collaborator
|
It usually depends upon there being enough fixes to bother. Right now it seems there's no bugs marked as addressed in next version? Oh this PR actually closed the bug. We usually just mark them as 'addressed in next version'. Let me check to see if there are others. |
Collaborator
|
I think we want to fix a number of issues and after that release. Typeshed updated too. Hopefully in the next week |
Contributor
Author
|
Y'all's time and energy is very much appreciated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11320 by having
_getExtendedConfigurationstake in a "search directory" to fallback to searching if we load thepyproject.tomland it doesn't contain a[tool.pyright](which it then loads by calling_getExtendedConfigurations).This makes it so we still only read/parse the config once, while being able to "fallback" correctly.