diff --git a/docs/modules.md b/docs/modules.md index f69bc580e..4b17e8799 100644 --- a/docs/modules.md +++ b/docs/modules.md @@ -56,3 +56,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. diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 946c814a5..6682732aa 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -47,6 +47,22 @@ or pyright's `stubPath` 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`