mirror of
https://github.com/astral-sh/ty.git
synced 2025-12-23 05:36:53 +00:00
Bump version to 0.0.1-alpha.9 (#634)
This commit is contained in:
parent
e69569b4fe
commit
2feba5eb22
7 changed files with 86 additions and 10 deletions
4
docs/reference/cli.md
generated
4
docs/reference/cli.md
generated
|
|
@ -65,9 +65,9 @@ over all configuration files.</p>
|
|||
<p>Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.</p>
|
||||
</dd><dt id="ty-check--python"><a href="#ty-check--python"><code>--python</code></a> <i>path</i></dt><dd><p>Path to the Python environment.</p>
|
||||
<p>ty uses the Python environment to resolve type information and third-party dependencies.</p>
|
||||
<p>If not specified, ty will attempt to infer it from the <code>VIRTUAL_ENV</code> environment variable or discover a <code>.venv</code> directory in the project root or working directory.</p>
|
||||
<p>If not specified, ty will attempt to infer it from the <code>VIRTUAL_ENV</code> or <code>CONDA_PREFIX</code> environment variables, or discover a <code>.venv</code> directory in the project root or working directory.</p>
|
||||
<p>If a path to a Python interpreter is provided, e.g., <code>.venv/bin/python3</code>, ty will attempt to find an environment two directories up from the interpreter's path, e.g., <code>.venv</code>. At this time, ty does not invoke the interpreter to determine the location of the environment. This means that ty will not resolve dynamic executables such as a shim.</p>
|
||||
<p>ty will search in the resolved environments's <code>site-packages</code> directories for type information and third-party imports.</p>
|
||||
<p>ty will search in the resolved environment's <code>site-packages</code> directories for type information and third-party imports.</p>
|
||||
</dd><dt id="ty-check--python-platform"><a href="#ty-check--python-platform"><code>--python-platform</code></a>, <code>--platform</code> <i>platform</i></dt><dd><p>Target platform to assume when resolving types.</p>
|
||||
<p>This is used to specialize the type of <code>sys.platform</code> and will affect the visibility of platform-specific functions and attributes. If the value is set to <code>all</code>, no assumptions are made about the target platform. If unspecified, the current system's platform will be used.</p>
|
||||
</dd><dt id="ty-check--python-version"><a href="#ty-check--python-version"><code>--python-version</code></a>, <code>--target-version</code> <i>version</i></dt><dd><p>Python version to assume when resolving types.</p>
|
||||
|
|
|
|||
18
docs/reference/configuration.md
generated
18
docs/reference/configuration.md
generated
|
|
@ -76,6 +76,7 @@ python = "./.venv"
|
|||
Specifies the target platform that will be used to analyze the source code.
|
||||
If specified, ty will understand conditions based on comparisons with `sys.platform`, such
|
||||
as are commonly found in typeshed to reflect the differing contents of the standard library across platforms.
|
||||
If `all` is specified, ty will assume that the source code can run on any platform.
|
||||
|
||||
If no platform is specified, ty will use the current platform:
|
||||
- `win32` for Windows
|
||||
|
|
@ -86,7 +87,7 @@ If no platform is specified, ty will use the current platform:
|
|||
|
||||
**Default value**: `<current-platform>`
|
||||
|
||||
**Type**: `"win32" | "darwin" | "android" | "ios" | "linux" | str`
|
||||
**Type**: `"win32" | "darwin" | "android" | "ios" | "linux" | "all" | str`
|
||||
|
||||
**Example usage** (`pyproject.toml`):
|
||||
|
||||
|
|
@ -105,9 +106,18 @@ The version should be specified as a string in the format `M.m` where `M` is the
|
|||
and `m` is the minor (e.g. `"3.0"` or `"3.6"`).
|
||||
If a version is provided, ty will generate errors if the source code makes use of language features
|
||||
that are not supported in that version.
|
||||
It will also understand conditionals based on comparisons with `sys.version_info`, such
|
||||
as are commonly found in typeshed to reflect the differing contents of the standard
|
||||
library across Python versions.
|
||||
|
||||
If a version is not specified, ty will try the following techniques in order of preference
|
||||
to determine a value:
|
||||
1. Check for the `project.requires-python` setting in a `pyproject.toml` file
|
||||
and use the minimum version from the specified range
|
||||
2. Check for an activated or configured virtual environment
|
||||
and use the Python version of that environment
|
||||
3. Fall back to the default value (see below)
|
||||
|
||||
For some language features, ty can also understand conditionals based on comparisons
|
||||
with `sys.version_info`. These are commonly found in typeshed, for example,
|
||||
to reflect the differing contents of the standard library across Python versions.
|
||||
|
||||
**Default value**: `"3.13"`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue