This commit is contained in:
Nate Lust 2025-12-22 12:05:03 -05:00 committed by GitHub
commit 501faf516e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

@ -60,3 +60,11 @@ The Python environment may be explicitly configured using the
[`--python`](./reference/cli.md#ty-check--python) flag.
When setting the environment explicitly, non-virtual environments can be provided.
## PYTHONPATH
Python supports setting the `PYTHONPATH` environment variable to control module lookup
per-environment.
If ty should read this environment variable for lookup paths
[`environment.read-python-path`](./reference/configuration.md#read-python-path) should be set to true.

View file

@ -52,6 +52,22 @@ configuration setting.
extra-paths = ["./shared/my-search-path"]
```
### `read-python-path`
Boolean to indicate if ty should read paths found in the `PYTHONPATH` environment variable.
This may be needed by tools which setup python library paths on a per-shell basis.
**Default value**: `false`
**Type**: `bool`
**Example usage** (`pyproject.toml`):
```toml
[tool.ty.environment]
read-python-path = true
```
---
### `python`