ty 0.0.1a32__py3-none-musllinux_1_2_armv7l.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ty/__init__.py +0 -0
- ty/__main__.py +86 -0
- ty/py.typed +1 -0
- ty-0.0.1a32.data/scripts/ty +0 -0
- ty-0.0.1a32.dist-info/METADATA +108 -0
- ty-0.0.1a32.dist-info/RECORD +8 -0
- ty-0.0.1a32.dist-info/WHEEL +4 -0
- ty-0.0.1a32.dist-info/licenses/LICENSE +21 -0
ty/__init__.py
ADDED
|
File without changes
|
ty/__main__.py
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import sysconfig
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def find_ty_bin() -> str:
|
|
9
|
+
"""Return the ty binary path."""
|
|
10
|
+
|
|
11
|
+
ty_exe = "ty" + sysconfig.get_config_var("EXE")
|
|
12
|
+
|
|
13
|
+
scripts_path = os.path.join(sysconfig.get_path("scripts"), ty_exe)
|
|
14
|
+
if os.path.isfile(scripts_path):
|
|
15
|
+
return scripts_path
|
|
16
|
+
|
|
17
|
+
if sys.version_info >= (3, 10):
|
|
18
|
+
user_scheme = sysconfig.get_preferred_scheme("user")
|
|
19
|
+
elif os.name == "nt":
|
|
20
|
+
user_scheme = "nt_user"
|
|
21
|
+
elif sys.platform == "darwin" and sys._framework:
|
|
22
|
+
user_scheme = "osx_framework_user"
|
|
23
|
+
else:
|
|
24
|
+
user_scheme = "posix_user"
|
|
25
|
+
|
|
26
|
+
user_path = os.path.join(sysconfig.get_path("scripts", scheme=user_scheme), ty_exe)
|
|
27
|
+
if os.path.isfile(user_path):
|
|
28
|
+
return user_path
|
|
29
|
+
|
|
30
|
+
# Search in `bin` adjacent to package root (as created by `pip install --target`).
|
|
31
|
+
pkg_root = os.path.dirname(os.path.dirname(__file__))
|
|
32
|
+
target_path = os.path.join(pkg_root, "bin", ty_exe)
|
|
33
|
+
if os.path.isfile(target_path):
|
|
34
|
+
return target_path
|
|
35
|
+
|
|
36
|
+
# Search for pip-specific build environments.
|
|
37
|
+
#
|
|
38
|
+
# Expect to find ty in <prefix>/pip-build-env-<rand>/overlay/bin/ty
|
|
39
|
+
# Expect to find a "normal" folder at <prefix>/pip-build-env-<rand>/normal
|
|
40
|
+
#
|
|
41
|
+
# See: https://github.com/pypa/pip/blob/102d8187a1f5a4cd5de7a549fd8a9af34e89a54f/src/pip/_internal/build_env.py#L87
|
|
42
|
+
paths = os.environ.get("PATH", "").split(os.pathsep)
|
|
43
|
+
if len(paths) >= 2:
|
|
44
|
+
|
|
45
|
+
def get_last_three_path_parts(path: str) -> list[str]:
|
|
46
|
+
"""Return a list of up to the last three parts of a path."""
|
|
47
|
+
parts = []
|
|
48
|
+
|
|
49
|
+
while len(parts) < 3:
|
|
50
|
+
head, tail = os.path.split(path)
|
|
51
|
+
if tail or head != path:
|
|
52
|
+
parts.append(tail)
|
|
53
|
+
path = head
|
|
54
|
+
else:
|
|
55
|
+
parts.append(path)
|
|
56
|
+
break
|
|
57
|
+
|
|
58
|
+
return parts
|
|
59
|
+
|
|
60
|
+
maybe_overlay = get_last_three_path_parts(paths[0])
|
|
61
|
+
maybe_normal = get_last_three_path_parts(paths[1])
|
|
62
|
+
if (
|
|
63
|
+
len(maybe_normal) >= 3
|
|
64
|
+
and maybe_normal[-1].startswith("pip-build-env-")
|
|
65
|
+
and maybe_normal[-2] == "normal"
|
|
66
|
+
and len(maybe_overlay) >= 3
|
|
67
|
+
and maybe_overlay[-1].startswith("pip-build-env-")
|
|
68
|
+
and maybe_overlay[-2] == "overlay"
|
|
69
|
+
):
|
|
70
|
+
# The overlay must contain the ty binary.
|
|
71
|
+
candidate = os.path.join(paths[0], ty_exe)
|
|
72
|
+
if os.path.isfile(candidate):
|
|
73
|
+
return candidate
|
|
74
|
+
|
|
75
|
+
raise FileNotFoundError(scripts_path)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if __name__ == "__main__":
|
|
79
|
+
ty = os.fsdecode(find_ty_bin())
|
|
80
|
+
if sys.platform == "win32":
|
|
81
|
+
import subprocess
|
|
82
|
+
|
|
83
|
+
completed_process = subprocess.run([ty, *sys.argv[1:]])
|
|
84
|
+
sys.exit(completed_process.returncode)
|
|
85
|
+
else:
|
|
86
|
+
os.execvp(ty, [ty, *sys.argv[1:]])
|
ty/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
Binary file
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ty
|
|
3
|
+
Version: 0.0.1a32
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Rust
|
|
18
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
|
+
Classifier: Topic :: Software Development :: Testing
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Summary: An extremely fast Python type checker, written in Rust.
|
|
24
|
+
Keywords: ty,typing,analysis,check
|
|
25
|
+
Home-Page: https://github.com/astral-sh/ty/
|
|
26
|
+
Author-email: "Astral Software Inc." <hey@astral.sh>
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
29
|
+
Project-URL: Repository, https://github.com/astral-sh/ty
|
|
30
|
+
Project-URL: Changelog, https://github.com/astral-sh/ty/blob/main/CHANGELOG.md
|
|
31
|
+
Project-URL: Releases, https://github.com/astral-sh/ty/releases
|
|
32
|
+
Project-URL: Discord, https://discord.gg/astral-sh
|
|
33
|
+
|
|
34
|
+
# ty
|
|
35
|
+
|
|
36
|
+
[](https://github.com/astral-sh/ty)
|
|
37
|
+
[](https://pypi.python.org/pypi/ty)
|
|
38
|
+
[](https://discord.com/invite/astral-sh)
|
|
39
|
+
|
|
40
|
+
An extremely fast Python type checker and language server, written in Rust.
|
|
41
|
+
|
|
42
|
+
## Getting started
|
|
43
|
+
|
|
44
|
+
Try out the [online playground](https://play.ty.dev), or run ty with
|
|
45
|
+
[uvx](https://docs.astral.sh/uv/guides/tools/#running-tools) to get started quickly:
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
uvx ty
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For other ways to install ty, see the [installation](https://docs.astral.sh/ty/installation/) documentation.
|
|
52
|
+
|
|
53
|
+
If you do not provide a subcommand, ty will list available commands — for detailed information about
|
|
54
|
+
command-line options, see the [CLI reference](https://docs.astral.sh/ty/reference/cli/).
|
|
55
|
+
|
|
56
|
+
Use the `check` command to run the type checker:
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
uvx ty check
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
ty will run on all Python files in the working directory and or subdirectories. If used from a
|
|
63
|
+
project, ty will run on all Python files in the project (starting in the directory with the
|
|
64
|
+
`pyproject.toml`)
|
|
65
|
+
|
|
66
|
+
You can also provide specific paths to check:
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
uvx ty check example.py
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
When type checking, ty will find installed packages in the active virtual environment (via
|
|
73
|
+
`VIRTUAL_ENV`) or discover a virtual environment named `.venv` in the project root or working
|
|
74
|
+
directory. It will not find packages in non-virtual environments without specifying the target path
|
|
75
|
+
with `--python`. See the [module discovery](https://docs.astral.sh/ty/modules/) documentation for
|
|
76
|
+
details.
|
|
77
|
+
|
|
78
|
+
## Learning more
|
|
79
|
+
|
|
80
|
+
To learn more about using ty, see the [documentation](https://docs.astral.sh/ty/).
|
|
81
|
+
|
|
82
|
+
## Getting involved
|
|
83
|
+
|
|
84
|
+
If you have questions or want to report a bug, please open an
|
|
85
|
+
[issue](https://github.com/astral-sh/ty/issues) in this repository.
|
|
86
|
+
|
|
87
|
+
Development of this project takes place in the [Ruff](https://github.com/astral-sh/ruff) repository
|
|
88
|
+
at this time. Please [open pull requests](https://github.com/astral-sh/ruff/pulls) there for changes
|
|
89
|
+
to anything in the `ruff` submodule (which includes all of the Rust source code).
|
|
90
|
+
|
|
91
|
+
See the
|
|
92
|
+
[contributing guide](https://github.com/astral-sh/ty/blob/0.0.1-alpha.32/CONTRIBUTING.md) for more details.
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
ty is licensed under the MIT license ([LICENSE](https://github.com/astral-sh/ty/blob/0.0.1-alpha.32/LICENSE) or
|
|
97
|
+
<https://opensource.org/licenses/MIT>).
|
|
98
|
+
|
|
99
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in ty
|
|
100
|
+
by you, as defined in the MIT license, shall be licensed as above, without any additional terms or
|
|
101
|
+
conditions.
|
|
102
|
+
|
|
103
|
+
<div align="center">
|
|
104
|
+
<a target="_blank" href="https://astral.sh" style="background:none">
|
|
105
|
+
<img src="https://raw.githubusercontent.com/astral-sh/uv/main/assets/svg/Astral.svg" alt="Made by Astral">
|
|
106
|
+
</a>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
ty-0.0.1a32.data/scripts/ty,sha256=A9yP7_vZZXDt2lH05v0e8giQ-RFiLj-xWX79uNxSC_o,18900292
|
|
2
|
+
ty-0.0.1a32.dist-info/METADATA,sha256=ijxE_1TVlD3Bcab5o76J1w59fwoo1K6C55kDJoiDw2A,4478
|
|
3
|
+
ty-0.0.1a32.dist-info/WHEEL,sha256=5zM2P9bZ27Rybh1N4NJMl8JtQgoHSBH97pYhjTn7gqU,105
|
|
4
|
+
ty-0.0.1a32.dist-info/licenses/LICENSE,sha256=hg49eoa4TmpwEsemNfxk30dc68bM403-tzpZguxYF2w,1077
|
|
5
|
+
ty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
ty/__main__.py,sha256=EFz_yrs8nZWhIs1P5u76AQdloJrLT5K3-BwDjBEMi3s,2875
|
|
7
|
+
ty/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
8
|
+
ty-0.0.1a32.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Astral Software Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|