mirror of
https://github.com/astral-sh/uv
synced 2026-01-20 21:10:10 -05:00
Use ty to type-check Python files (#17229)
I added mypy type‑checking in https://github.com/astral-sh/uv/pull/5332, so I think it's a good time to switch to ty now :)
This commit is contained in:
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@@ -116,7 +116,12 @@ jobs:
|
||||
run: uvx ruff check .
|
||||
|
||||
- name: "Python type check"
|
||||
run: uvx mypy
|
||||
run: |
|
||||
uvx ty check python/uv
|
||||
uvx \
|
||||
--directory crates/uv-python \
|
||||
--with-requirements fetch-download-metadata.py \
|
||||
ty check --python-version 3.13 fetch-download-metadata.py
|
||||
|
||||
- name: "Validate project metadata"
|
||||
run: uvx --from 'validate-pyproject[all,store]' validate-pyproject pyproject.toml
|
||||
|
||||
@@ -92,12 +92,5 @@ version_files = [
|
||||
"Documentation" = ["documentation"]
|
||||
"Other changes" = ["__unknown__"]
|
||||
|
||||
[tool.mypy]
|
||||
ignore_missing_imports = true
|
||||
files = [
|
||||
"crates/uv-python/*.py",
|
||||
"python/uv/*.py",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
managed = false
|
||||
|
||||
@@ -94,7 +94,7 @@ def _user_scheme() -> str:
|
||||
user_scheme = sysconfig.get_preferred_scheme("user")
|
||||
elif os.name == "nt":
|
||||
user_scheme = "nt_user"
|
||||
elif sys.platform == "darwin" and sys._framework:
|
||||
elif sys.platform == "darwin" and sys._framework: # ty: ignore[unresolved-attribute]
|
||||
user_scheme = "osx_framework_user"
|
||||
else:
|
||||
user_scheme = "posix_user"
|
||||
|
||||
Reference in New Issue
Block a user