Skip to content

[ty] Fall back to python3 found in $PATH if no environment is found#22843

Merged
carljm merged 13 commits intoastral-sh:mainfrom
figsoda:path-env
Feb 10, 2026
Merged

[ty] Fall back to python3 found in $PATH if no environment is found#22843
carljm merged 13 commits intoastral-sh:mainfrom
figsoda:path-env

Conversation

@figsoda
Copy link
Contributor

@figsoda figsoda commented Jan 25, 2026

Summary

I have a python environment setup using Nixpkgs' python3.withPackages, which, if I understand correctly, basically wraps the regular python binary and uses site.addsitedir to introduce the site packages.

This didn't work with ty out of the box, and using ty check --python $(which python3) or setting environment.python to the wrapped python binary fixes it for me.

This pull request makes it so that PythonEnvironment::discover falls back to $(which python3). I'm not sure if this is the right way to do this, feel free to turn this into an issue if it's not.

Test Plan

I have only tested it with my own setup with python3.withPackages.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 25, 2026

Typing conformance results

No changes detected ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 25, 2026

mypy_primer results

Changes were detected when running on open source projects
Expression (https://github.com/cognitedata/Expression)
+ tests/test_compose.py:21:16: error[invalid-assignment] Object of type `(Never, /) -> Never` is not assignable to `(int, /) -> int`
- Found 204 diagnostics
+ Found 205 diagnostics

setuptools (https://github.com/pypa/setuptools)
+ setuptools/_distutils/command/install.py:719:42: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `map[str]`
- Found 1126 diagnostics
+ Found 1127 diagnostics

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/deployments/runner.py:1017:70: warning[possibly-missing-attribute] Attribute `__name__` may be missing on object of type `Unknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))`
+ src/prefect/deployments/runner.py:1017:70: warning[possibly-missing-attribute] Attribute `__name__` may be missing on object of type `Unknown | ((...) -> Any)`
+ src/prefect/flow_engine.py:1004:32: error[invalid-await] `Unknown | R@FlowRunEngine | Coroutine[Any, Any, R@FlowRunEngine]` is not awaitable
+ src/prefect/flow_engine.py:1610:24: error[invalid-await] `Unknown | R@AsyncFlowRunEngine | Coroutine[Any, Any, R@AsyncFlowRunEngine]` is not awaitable
+ src/prefect/flow_engine.py:1691:43: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Unknown | R@run_generator_flow_sync`
+ src/prefect/flow_engine.py:1699:21: warning[possibly-missing-attribute] Attribute `throw` may be missing on object of type `Unknown | R@run_generator_flow_sync`
+ src/prefect/flow_engine.py:1733:44: warning[possibly-missing-attribute] Attribute `__anext__` may be missing on object of type `Unknown | R@run_generator_flow_async`
+ src/prefect/flow_engine.py:1740:25: warning[possibly-missing-attribute] Attribute `throw` may be missing on object of type `Unknown | R@run_generator_flow_async`
- src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
- src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
- src/prefect/flows.py:1886:53: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/prefect/flows.py:1946:21: error[no-matching-overload] No overload of function `run_coro_as_sync` matches arguments
- Found 5499 diagnostics
+ Found 5505 diagnostics

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ src/scikit_build_core/build/wheel.py:99:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 49 diagnostics
+ Found 50 diagnostics

materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/cli/mz_workload_anonymize.py:251:13: error[no-matching-overload] No overload of bound method `join` matches arguments
- Found 535 diagnostics
+ Found 534 diagnostics

sympy (https://github.com/sympy/sympy)
+ sympy/algebras/tests/test_quaternion.py:75:10: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/algebras/tests/test_quaternion.py:75:10: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/algebras/tests/test_quaternion.py:422:33: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/codegen/tests/test_matrix_nodes.py:27:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
- sympy/geometry/point.py:1295:25: warning[possibly-missing-attribute] Attribute `tolist` may be missing on object of type `MatrixBase | Expr`
+ sympy/geometry/point.py:1295:25: warning[possibly-missing-attribute] Attribute `tolist` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/integrals/tests/test_heurisch.py:390:26: error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
+ sympy/integrals/tests/test_heurisch.py:389:17: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/decompositions.py:1321:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1321:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1334:13: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase`
- sympy/matrices/decompositions.py:1336:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1336:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1348:13: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase`
- sympy/matrices/decompositions.py:1350:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition]`, found `tuple[MatrixBase | Expr | Unknown, MatrixBase, MatrixBase | Expr | Unknown]`
+ sympy/matrices/decompositions.py:1350:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition]`, found `tuple[Unknown | MatrixBase, MatrixBase, MatrixBase | Unknown]`
+ sympy/matrices/eigen.py:328:22: error[invalid-argument-type] Argument to bound method `_as_type` is incorrect: Expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
+ sympy/matrices/eigen.py:1202:37: error[unresolved-attribute] Object of type `T2'return@call_highest_priority | T1'return@call_highest_priority` has no attribute `pow`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:235:13: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:235:33: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:235:53: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:459:12: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_derivatives.py:551:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matadd.py:36:12: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/expressions/tests/test_matmul.py:158:68: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matmul.py:158:68: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matpow.py:123:46: error[unsupported-operator] Operator `**` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Literal[2]`
+ sympy/matrices/expressions/tests/test_matpow.py:124:47: error[unsupported-operator] Operator `+` is not supported between two objects of type `ImmutableDenseMatrix`
- sympy/matrices/expressions/tests/test_permutation.py:27:12: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_permutation.py:27:12: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/inverse.py:384:11: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase`
+ sympy/matrices/inverse.py:392:11: error[unsupported-operator] Unary operator `-` is not supported for object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/inverse.py:393:19: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase | Expr`
+ sympy/matrices/inverse.py:393:22: error[unsupported-operator] Unary operator `-` is not supported for object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/matrixbase.py:979:18: error[unsupported-operator] Operator `+` is not supported between two objects of type `Self@_eval_wilkinson`
+ sympy/matrices/matrixbase.py:2957:16: error[invalid-return-type] Return type does not match returned value: expected `Self@_eval_pow_by_cayley`, found `Self@_eval_pow_by_cayley | T2'return@call_highest_priority | T1'return@call_highest_priority`
- sympy/matrices/matrixbase.py:3046:5: error[invalid-argument-type] Argument is incorrect: Expected `(MatrixBase, MatrixBase | Expr, /) -> MatrixBase | Expr`, found `Overload[[Self](self, other: Self) -> Self, (self, other: MatrixBase) -> MatrixBase, (self, other: Expr) -> MatrixBase]`
+ sympy/matrices/matrixbase.py:3046:5: error[invalid-argument-type] Argument is incorrect: Expected `(T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr, T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr, /) -> T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`, found `Overload[[Self](self, other: Self) -> Self, (self, other: MatrixBase) -> MatrixBase, (self, other: Expr) -> MatrixBase]`
+ sympy/matrices/matrixbase.py:3256:16: error[invalid-return-type] Return type does not match returned value: expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority`
+ sympy/matrices/matrixbase.py:3256:29: error[invalid-argument-type] Argument is incorrect: Expected `T2'return@call_highest_priority | T1'return@call_highest_priority`, found `MatrixBase`
+ sympy/matrices/matrixbase.py:3310:16: error[unsupported-operator] Operator `+` is not supported between two objects of type `MatrixBase`
+ sympy/matrices/matrixbase.py:3314:16: error[invalid-return-type] Return type does not match returned value: expected `Tmat@__sub__`, found `MatrixBase`
+ sympy/matrices/matrixbase.py:3944:39: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/matrixbase.py:3944:39: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/matrixbase.py:4386:16: error[unsupported-operator] Operator `+` is not supported between two objects of type `Self@add`
- sympy/matrices/matrixbase.py:4640:16: error[invalid-return-type] Return type does not match returned value: expected `Self@D`, found `MatrixBase | Expr`
+ sympy/matrices/matrixbase.py:4640:16: error[invalid-return-type] Return type does not match returned value: expected `Self@D`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/matrixbase.py:4748:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/matrixbase.py:4748:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/matrixbase.py:4923:16: error[invalid-return-type] Return type does not match returned value: expected `Self@analytic_func`, found `Self@analytic_func | T2'return@call_highest_priority | T1'return@call_highest_priority`
- sympy/matrices/matrixbase.py:5078:16: error[invalid-return-type] Return type does not match returned value: expected `Self@log`, found `MatrixBase | @Todo | Expr`
+ sympy/matrices/matrixbase.py:5076:19: error[unsupported-operator] Operator `*` is not supported between objects of type `@Todo | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `@Todo | Self@log`
+ sympy/matrices/repmatrix.py:321:17: error[unsupported-operator] Operator `-` is not supported between two objects of type `Self@_eval_is_symmetric`
+ sympy/matrices/solvers.py:637:27: error[invalid-argument-type] Argument to bound method `vstack` is incorrect: Argument type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` does not satisfy upper bound `MatrixBase` of type variable `Self`
+ sympy/matrices/solvers.py:637:27: error[invalid-argument-type] Argument to bound method `vstack` is incorrect: Expected `Tmat@_gauss_jordan_solve`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
- sympy/matrices/solvers.py:976:16: warning[possibly-missing-attribute] Attribute `solve` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/solvers.py:976:16: warning[possibly-missing-attribute] Attribute `solve` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Argument type `MatrixBase | Expr` does not satisfy upper bound `MatrixBase` of type variable `Self`
+ sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Argument type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` does not satisfy upper bound `MatrixBase` of type variable `Self`
- sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Expected `MatrixBase`, found `MatrixBase | Expr`
+ sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/sparse.py:417:16: warning[possibly-missing-attribute] Attribute `inv` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/sparse.py:417:16: warning[possibly-missing-attribute] Attribute `inv` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_commonmatrix.py:1249:31: error[unsupported-operator] Operator `+` is not supported between objects of type `MutableDenseMatrix` and `ImmutableDenseNDimArray`
- sympy/matrices/tests/test_decompositions.py:23:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:23:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:32:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:32:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:42:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:42:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:51:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:51:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:57:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:57:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:77:19: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:84:19: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:90:19: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:103:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:110:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:123:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:131:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:131:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:288:10: warning[possibly-missing-attribute] Attribute `applyfunc` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:288:10: warning[possibly-missing-attribute] Attribute `applyfunc` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:393:16: error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_decompositions.py:394:16: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:290:13: error[unsupported-operator] Operator `-` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:345:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:348:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:355:23: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:393:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:394:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:395:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:395:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:396:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:396:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:439:13: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:439:22: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:451:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:451:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:464:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:464:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:475:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:475:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:488:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_decompositions.py:488:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_eigen.py:477:12: error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_eigen.py:492:12: warning[possibly-missing-attribute] Attribute `applyfunc` may be missing on object of type `MatrixBase | Expr | Unknown`
+ sympy/matrices/tests/test_eigen.py:257:16: warning[possibly-missing-attribute] Attribute `n` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_eigen.py:306:14: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:307:14: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:322:15: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:323:15: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:364:14: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:365:14: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:380:15: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:381:15: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:405:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:477:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:492:13: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:793:19: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_immutable.py:105:23: error[unsupported-operator] Operator `+` is not supported between two objects of type `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:121:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:123:32: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:141:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:201:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:201:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:202:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:202:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:203:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:203:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:204:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:204:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:205:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:205:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:206:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:206:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:213:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:213:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:214:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:214:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:215:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:215:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:216:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:216:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:217:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:217:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:218:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrices.py:218:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:221:40: error[invalid-argument-type] Argument to bound method `multiply_elementwise` is incorrect: Expected `MatrixBase`, found `MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:221:40: error[invalid-argument-type] Argument to bound method `multiply_elementwise` is incorrect: Expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:394:16: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:1739:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_matrices.py:1581:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1587:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1594:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1599:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1607:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1616:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1739:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2179:22: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2207:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2557:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:2680:16: error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_matrices.py:2681:16: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_matrices.py:2680:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2681:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:2682:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:2682:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrices.py:2683:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:2683:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrices.py:2728:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:2728:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrices.py:2746:25: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:2746:25: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:2908:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2921:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2936:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2937:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2948:14: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:3055:33: warning[possibly-missing-attribute] Attribute `analytic_func` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:3055:33: warning[possibly-missing-attribute] Attribute `analytic_func` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrices.py:3071:60: warning[possibly-missing-attribute] Attribute `exp` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:3071:60: warning[possibly-missing-attribute] Attribute `exp` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrices.py:3471:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:3477:12: warning[possibly-missing-attribute] Attribute `rank` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
+ sympy/matrices/tests/test_matrices.py:3478:13: error[unsupported-operator] Operator `**` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` and `Literal[2]`
+ sympy/matrices/tests/test_matrices.py:3479:13: error[unsupported-operator] Operator `**` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` and `Literal[3]`
+ sympy/matrices/tests/test_matrixbase.py:491:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:493:32: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:544:12: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:823:31: error[unsupported-operator] Operator `+` is not supported between objects of type `MutableDenseMatrix` and `ImmutableDenseNDimArray`
+ sympy/matrices/tests/test_matrixbase.py:876:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:878:32: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:900:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:963:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:963:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:964:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:964:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:965:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:965:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:966:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:966:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:967:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:967:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:968:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:968:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_matrixbase.py:1148:16: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:2497:12: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_matrixbase.py:2339:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2345:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2352:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2357:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2365:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2374:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2497:21: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2931:22: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2959:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3288:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:3384:16: error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_matrixbase.py:3385:16: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_matrixbase.py:3384:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3385:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:3386:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3386:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrixbase.py:3387:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3387:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrixbase.py:3432:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3432:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrixbase.py:3450:25: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3450:25: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3610:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3624:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3639:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3640:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3652:14: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:3768:33: warning[possibly-missing-attribute] Attribute `analytic_func` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3768:33: warning[possibly-missing-attribute] Attribute `analytic_func` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrixbase.py:3784:60: warning[possibly-missing-attribute] Attribute `exp` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:3784:60: warning[possibly-missing-attribute] Attribute `exp` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_reductions.py:293:15: warning[possibly-missing-attribute] Attribute `expand` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_reductions.py:299:15: warning[possibly-missing-attribute] Attribute `expand` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_reductions.py:377:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_reductions.py:383:12: warning[possibly-missing-attribute] Attribute `rank` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
+ sympy/matrices/tests/test_reductions.py:384:13: error[unsupported-operator] Operator `**` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` and `Literal[2]`
+ sympy/matrices/tests/test_reductions.py:385:13: error[unsupported-operator] Operator `**` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` and `Literal[3]`
+ sympy/matrices/tests/test_solvers.py:68:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:129:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_solvers.py:129:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_solvers.py:132:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_solvers.py:132:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_solvers.py:332:16: error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_solvers.py:333:16: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_solvers.py:296:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:302:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:314:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:320:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:332:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:333:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
- sympy/matrices/tests/test_solvers.py:334:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_solvers.py:334:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_solvers.py:335:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_solvers.py:335:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_solvers.py:341:16: error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_solvers.py:342:16: error[no-matching-overload] No overload of function `simplify` matches arguments
+ sympy/matrices/tests/test_solvers.py:341:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:342:25: error[unsupported-operator] Operator `*` is not supported between objects of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Unknown | MutableDenseMatrix`
- sympy/matrices/tests/test_solvers.py:343:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_solvers.py:343:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_solvers.py:344:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | MatrixBase | Expr`
+ sympy/matrices/tests/test_solvers.py:344:16: warning[possibly-missing-attribute] Attribute `H` may be missing on object of type `Unknown | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_solvers.py:354:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:361:12: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:585:13: error[unsupported-operator] Operator `-` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_sparse.py:91:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:91:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:92:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:92:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:93:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:93:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:94:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:94:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:95:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:95:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:96:12: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:96:12: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:103:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:103:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:104:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:104:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:105:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:105:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:106:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:106:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:107:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:107:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:108:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:108:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_sparse.py:336:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy

... (truncated 90 lines) ...

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 25, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@figsoda figsoda force-pushed the path-env branch 2 times, most recently from e1be8c6 to 2d6c9c8 Compare January 25, 2026 02:13
@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Jan 25, 2026
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks. I think I'm in favour of this -- this is a simple fallback that is also used by pyright and pyrefly. We've talked in the past about using uv to determine where system Python environments are located, but I'm sceptical that using uv would work as well as this because:

  • not all ty users will have uv installed, and we can only use uv's system-Python detection if uv is also installed
  • if they do have uv installed, they're likely a uv user, and most uv users will anyway be using virtual environments. We already handle Python environment detection just fine if a virtual environment is either activated or placed in a conventional location.

If we want to improve our system environment detection, I think it has to work well for non-uv users, since most people using system Python environments will likely not be uv users.

@figsoda
Copy link
Contributor Author

figsoda commented Jan 25, 2026

Thanks for the review! I'm not familar with the code base, and I'm not sure what the test failures entail. I'm guessing they make different assumptions about the python environment found in CI?

@AlexWaygood
Copy link
Member

When I run cargo test -p ty locally, I see many failures like this:

---- search_path stdout ----
Error: Failed to discover the site-packages directory

Caused by:
    Failed to iterate over the contents of the `lib`/`lib64` directories of the Python installation `/Users/alexw/.pyenv`

Which implies that:

  1. the mechanism you're using to lookup python3/python is hard to reliably test, because we'll end up accidentally resolving to the user's system installation in many tests where we don't want any Python environment to be discovered at all
  2. We need to more gracefully fallback if python or python3 points to a shim rather than a proper executable

With regards to (1), the technique we use elsewhere is to extend the *System abstractions in the ruff_db crate. For example, rather than setting the VIRTUAL_ENV environment variable directly in tests, we use the TestSystem::set_env_var() method, which means that our tests won't mind if the user already (accidentally?) has VIRTUAL_ENV set locally:

/// Sets an environment variable override. This takes precedence over the inner system.
pub fn set_env_var(&self, name: impl Into<String>, value: impl Into<String>) {
self.env_overrides
.lock()
.unwrap()
.insert(name.into(), Some(value.into()));
}

// Create test system and set environment variable overrides
let test_system = Arc::new(TestSystem::new(os_system));
for (name, value) in env_vars {
match value {
Some(value) => {
test_system.set_env_var(name, value);
}
None => test_system.remove_env_var(name),
}
}

I don't know what the solution to (2) is

@figsoda figsoda requested a review from Gankra as a code owner January 26, 2026 22:07
@figsoda
Copy link
Contributor Author

figsoda commented Jan 26, 2026

Thanks for the pointer on (1), I was able to pass all the e2e tests with a fake python. Note that this does unset $PATH in the tests, so stuff like uv would also be gone if we were to stop using Command::new for them, but a simple patch like this would be able to fix that.

diff --git a/Cargo.lock b/Cargo.lock
index 317e73b662..ed011de866 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4660,6 +4660,7 @@ dependencies = [
  "ty_module_resolver",
  "ty_project",
  "ty_python_semantic",
+ "which",
 ]
 
 [[package]]
diff --git a/crates/ty_server/Cargo.toml b/crates/ty_server/Cargo.toml
index d3597df57c..a1d48298ba 100644
--- a/crates/ty_server/Cargo.toml
+++ b/crates/ty_server/Cargo.toml
@@ -39,6 +39,7 @@ shellexpand = { workspace = true }
 thiserror = { workspace = true }
 tracing = { workspace = true }
 tracing-subscriber = { workspace = true, features = ["chrono"] }
+which = { workspace = true }
 
 [target.'cfg(target_vendor = "apple")'.dependencies]
 libc = { workspace = true }
diff --git a/crates/ty_server/tests/e2e/main.rs b/crates/ty_server/tests/e2e/main.rs
index 0eb422dd16..2949b9d588 100644
--- a/crates/ty_server/tests/e2e/main.rs
+++ b/crates/ty_server/tests/e2e/main.rs
@@ -1138,6 +1138,20 @@ impl TestServerBuilder {
         self
     }
 
+    pub(crate) fn with_binaries(mut self, binaries: &[&str]) -> Self {
+        let bin_dir = self.test_context._temp_dir.path().join("bin");
+        std::fs::create_dir_all(&bin_dir).unwrap();
+        for binary in binaries {
+            let src = which::which(binary).unwrap();
+            std::os::unix::fs::symlink(src, bin_dir.join(binary)).unwrap();
+        }
+        self.env_vars.push((
+            "PATH".into(),
+            Some(bin_dir.into_os_string().into_string().unwrap()),
+        ));
+        self
+    }
+
     /// Add a workspace to the test server with the given root path and options.
     ///
     /// This option will be used to respond to the `workspace/configuration` request that the

The file_watching tests are still failing at the moment since they are not using TestSystem

let system = OsSystem::new(&project_path);

As for (2), the operations in site_packages_directories_from_sys_prefix don't seem very expensive, maybe we can just run that directly or do something similar to that to make sure shims aren't counted as legitimate python binaries?

@carljm carljm removed their request for review January 27, 2026 01:18
@figsoda
Copy link
Contributor Author

figsoda commented Feb 1, 2026

looks like the shim check was enough for ci to be passing :)

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

@carljm
Copy link
Contributor

carljm commented Feb 3, 2026

Ideally we would add a test for this functionality -- but AFAICS PythonEnvironment::discover is currently untested, so adding tests for it seems like it would be breaking new ground, and that probably isn't a reasonable bar for this PR.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 10, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 707.86MB 710.01MB +0.3% (2.15MB)
sphinx 281.73MB 282.30MB +0.2% (0.57MB)
trio 123.55MB 123.94MB +0.3% (0.39MB)
flake8 51.79MB 51.85MB +0.1% (0.06MB)

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
File 0.25MB 0.28MB +10.8% (0.03MB)
Program 0.02MB 0.02MB +1.3% (0.00MB)
FileRoot 0.00MB 0.00MB +137.5% (0.00MB)
check_file_impl 0.32MB 0.34MB +8.8% (0.03MB)
resolve_module_query 0.03MB 0.04MB +11.0% (0.00MB)
dynamic_resolution_paths 0.00MB 0.00MB +57.9% (0.00MB)

prefect

Name Old New Diff Outcome
File 2.07MB 2.79MB +34.7% (0.72MB)
is_redundant_with_impl::interned_arguments 6.28MB 6.28MB -0.0% (-0.00MB)
UnionType 3.95MB 3.95MB -0.0% (-0.00MB)
IntersectionType 2.59MB 2.59MB -0.0% (-0.00MB)
Program 0.02MB 0.02MB +1.3% (0.00MB)
FileRoot 0.00MB 0.00MB +137.5% (0.00MB)
check_file_impl 16.04MB 17.39MB +8.4% (1.35MB)
resolve_module_query 0.42MB 0.55MB +29.6% (0.13MB)
infer_expression_types_impl 53.38MB 53.37MB -0.0% (-0.01MB)
infer_expression_type_impl 10.80MB 10.79MB -0.1% (-0.01MB)
infer_definition_types 86.69MB 86.68MB -0.0% (-0.01MB)
Type < 'db >::member_lookup_with_policy_ 15.84MB 15.84MB -0.0% (-0.00MB)
all_negative_narrowing_constraints_for_expression 1.59MB 1.59MB -0.1% (-0.00MB)
all_narrowing_constraints_for_expression 3.64MB 3.64MB -0.1% (-0.00MB)
StaticClassLiteral < 'db >::implicit_attribute_inner_ 10.27MB 10.27MB -0.0% (-0.00MB)
... 2 more

sphinx

Name Old New Diff Outcome
File 0.90MB 1.06MB +18.4% (0.17MB)
Program 0.02MB 0.02MB +1.3% (0.00MB)
FileRoot 0.00MB 0.00MB +137.5% (0.00MB)
check_file_impl 4.93MB 5.29MB +7.4% (0.36MB)
resolve_module_query 0.21MB 0.24MB +17.9% (0.04MB)
dynamic_resolution_paths 0.00MB 0.00MB +57.9% (0.00MB)

trio

Name Old New Diff Outcome
File 0.78MB 1.05MB +34.2% (0.27MB)
Program 0.02MB 0.02MB +1.3% (0.00MB)
FileRoot 0.00MB 0.00MB +137.5% (0.00MB)
check_file_impl 1.92MB 2.01MB +4.7% (0.09MB)
resolve_module_query 0.13MB 0.17MB +24.4% (0.03MB)
dynamic_resolution_paths 0.00MB 0.00MB +57.9% (0.00MB)

@AlexWaygood
Copy link
Member

I confirmed locally that all tests in the ty, ty_python_semantic, ty_server, ty_project and ruff_db crates now pass for me locally with this branch checked out. (My machine is a pretty good test case for ensuring test isolation since it has a HomeBrew system Python, multiple pyenv shims, and many uv-managed Python installations.)

@BurntSushi
Copy link
Member

I think you just need to rebase this on main, resolve conflicts and it should be good to go.

@carljm carljm merged commit 012ec63 into astral-sh:main Feb 10, 2026
50 checks passed
@figsoda figsoda deleted the path-env branch February 10, 2026 18:10
@AlexWaygood
Copy link
Member

We need to document this fallback here:

/// Path to your project's Python environment or interpreter.
///
/// ty uses the `site-packages` directory of your project's Python environment
/// to resolve third-party (and, in some cases, first-party) imports in your code.
///
/// If you're using a project management tool such as uv, you should not generally need
/// to specify this option, as commands such as `uv run` will set the `VIRTUAL_ENV`
/// environment variable to point to your project's virtual environment. ty can also infer
/// the location of your environment from an activated Conda environment, and will look for
/// a `.venv` directory in the project root if none of the above apply.
///
/// Passing a path to a Python executable is supported, but passing a path to a dynamic executable
/// (such as a shim) is not currently supported.
///
/// This option can be used to point to virtual or system Python environments.
#[serde(skip_serializing_if = "Option::is_none")]
#[option(
default = r#"null"#,
value_type = "str",
example = r#"
python = "./custom-venv-location/.venv"
"#
)]
pub python: Option<RelativePathBuf>,

and here: https://github.com/astral-sh/ty/blob/e96ea4cd97534cb43bee6111f36bdff109c181b5/docs/type-checking.md?plain=1#L18-L27

there is also documentation about our environment discovery here, but I'd be inclined not to add any more information here, since it's good for the CLI help text to be concise:

/// Path to your project's Python environment or interpreter.
///
/// ty uses your Python environment to resolve third-party imports in your code.
///
/// If you're using a project management tool such as uv or you have an activated Conda or virtual
/// environment, you should not generally need to specify this option.
///
/// This option can be used to point to virtual or system Python environments.
#[arg(long, value_name = "PATH", alias = "venv")]
pub(crate) python: Option<SystemPathBuf>,

@figsoda or @BurntSushi, would one of you be able to pick that up?

@BurntSushi
Copy link
Member

@AlexWaygood Ah nice catch! I put up #23229 and astral-sh/ty#2787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants