[ty] Tell the user why we inferred the Python version we inferred (#18082)

This commit is contained in:
Alex Waygood 2025-05-21 11:06:27 -04:00 committed by GitHub
parent cb9e66927e
commit d37592175f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 303 additions and 124 deletions

View file

@ -27,8 +27,7 @@ error[unsupported-operator]: Operator `|` is unsupported between objects of type
| ^^^^^^^^^
|
info: Note that `X | Y` PEP 604 union syntax is only available in Python 3.10 and later
info: The inferred target version of your project is Python 3.9
info: If using a pyproject.toml file, consider adjusting the `project.requires-python` or `tool.ty.environment.python-version` field
info: Python 3.9 was assumed when resolving types because it was specified on the command line
info: rule `unsupported-operator` is enabled by default
```

View file

@ -25,8 +25,7 @@ error[unresolved-reference]: Name `aiter` used when not defined
| ^^^^^
|
info: `aiter` was added as a builtin in Python 3.10
info: The inferred target version of your project is Python 3.9
info: If using a pyproject.toml file, consider adjusting the `project.requires-python` or `tool.ty.environment.python-version` field
info: Python 3.9 was assumed when resolving types because it was specified on the command line
info: rule `unresolved-reference` is enabled by default
```