ty 0.0.0a4__py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.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.
Potentially problematic release.
This version of ty might be problematic. Click here for more details.
- ty/__init__.py +0 -0
- ty/__main__.py +86 -0
- ty-0.0.0a4.data/scripts/ty +0 -0
- ty-0.0.0a4.dist-info/METADATA +46 -0
- ty-0.0.0a4.dist-info/RECORD +7 -0
- ty-0.0.0a4.dist-info/WHEEL +4 -0
- ty-0.0.0a4.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:]])
|
|
Binary file
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ty
|
|
3
|
+
Version: 0.0.0a4
|
|
4
|
+
License-File: LICENSE
|
|
5
|
+
Summary: An extremely fast Python type checker, written in Rust.
|
|
6
|
+
Home-Page: https://docs.astral.sh/ruff
|
|
7
|
+
Author: Charlie Marsh <charlie.r.marsh@gmail.com>
|
|
8
|
+
Author-email: "Astral Software Inc." <hey@astral.sh>
|
|
9
|
+
License: MIT
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
12
|
+
Project-URL: Source Code, https://github.com/astral-sh/ruff
|
|
13
|
+
|
|
14
|
+
# ty
|
|
15
|
+
|
|
16
|
+
An extremely fast Python type checker, written in Rust.
|
|
17
|
+
|
|
18
|
+
**This project is still in development and is not ready for production use.**
|
|
19
|
+
|
|
20
|
+
## Getting involved
|
|
21
|
+
|
|
22
|
+
If you have questions or want to report a bug, please open an
|
|
23
|
+
[issue](https://github.com/astral-sh/ty/issues) in this repository.
|
|
24
|
+
|
|
25
|
+
Development of this project takes place in the [Ruff](https://github.com/astral-sh/ruff) repository
|
|
26
|
+
at this time. Please [open pull requests](https://github.com/astral-sh/ruff/pulls) there for changes
|
|
27
|
+
to anything in the `ruff` submodule (which includes all of the Rust source code).
|
|
28
|
+
|
|
29
|
+
See the
|
|
30
|
+
[contributing guide](https://github.com/astral-sh/ty/blob/main/CONTRIBUTING.md) for more details.
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
ty is licensed under the MIT license ([LICENSE](LICENSE) or
|
|
35
|
+
<https://opensource.org/licenses/MIT>).
|
|
36
|
+
|
|
37
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in ty
|
|
38
|
+
by you, as defined in the MIT license, shall be licensed as above, without any additional terms or
|
|
39
|
+
conditions.
|
|
40
|
+
|
|
41
|
+
<div align="center">
|
|
42
|
+
<a target="_blank" href="https://astral.sh" style="background:none">
|
|
43
|
+
<img src="https://raw.githubusercontent.com/astral-sh/uv/main/assets/svg/Astral.svg" alt="Made by Astral">
|
|
44
|
+
</a>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ty-0.0.0a4.dist-info/METADATA,sha256=nUQQlEZ4o3V1SAOjrfMTy46hb2eNgwXAPVQv55G72r0,1670
|
|
2
|
+
ty-0.0.0a4.dist-info/WHEEL,sha256=tJj8FfMcSbHPBP6XwI2YkHlfe_1OQVYDqijM6kHtHZc,126
|
|
3
|
+
ty-0.0.0a4.dist-info/licenses/LICENSE,sha256=hg49eoa4TmpwEsemNfxk30dc68bM403-tzpZguxYF2w,1077
|
|
4
|
+
ty/__main__.py,sha256=EFz_yrs8nZWhIs1P5u76AQdloJrLT5K3-BwDjBEMi3s,2875
|
|
5
|
+
ty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
ty-0.0.0a4.data/scripts/ty,sha256=TgBuS8HSTxb80iGza84ZHz-4Rce1R0EW4crHZuHcS0I,15816336
|
|
7
|
+
ty-0.0.0a4.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.
|