Skip to content

Commit cef7737

Browse files
committed
chore: Migrate to ty type checker
1 parent 414db5f commit cef7737

File tree

5 files changed

+37
-84
lines changed

5 files changed

+37
-84
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__pycache__
2-
.mypy_cache
2+
.ty_cache
33
.pytest_cache
44
.ruff_cache
55

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ make format
4646

4747
### Type checking
4848

49-
Type checking is handled by [mypy](https://mypy.readthedocs.io/), verifying code against type annotations. Configuration settings can be found in `pyproject.toml`.
49+
Type checking is handled by [ty](https://docs.astral.sh/ty/), verifying code against type annotations. Configuration settings can be found in `pyproject.toml`.
5050

5151
To run type checking:
5252

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type-check check-code format
33

44
clean:
5-
rm -rf .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
5+
rm -rf .ty_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
66

77
install-dev:
88
uv sync --all-extras
@@ -25,7 +25,7 @@ unit-tests-cov:
2525
uv run pytest --numprocesses=auto --verbose --cov=src/apify_shared --cov-report=html tests/unit
2626

2727
type-check:
28-
uv run mypy
28+
uv run ty check
2929

3030
# The check-code target runs a series of checks equivalent to those performed by pre-commit hooks
3131
# and the run_checks.yaml GitHub Actions workflow.

pyproject.toml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ dependencies = []
4444
[dependency-groups]
4545
dev = [
4646
"dycw-pytest-only~=2.1.0",
47-
"mypy~=1.17.0",
4847
"pre-commit~=4.3.0",
4948
"pytest-asyncio~=1.1.0",
5049
"pytest-cov~=6.2.0",
@@ -53,7 +52,7 @@ dev = [
5352
"pytest~=8.4.0",
5453
"ruff~=0.12.0",
5554
"setuptools", # setuptools are used by pytest, but not explicitly required
56-
55+
"ty~=0.0.0",
5756
]
5857

5958
[tool.ruff]
@@ -100,16 +99,8 @@ asyncio_default_fixture_loop_scope = "function"
10099
asyncio_mode = "auto"
101100
timeout = 300
102101

103-
[tool.mypy]
104-
python_version = "3.10"
105-
files = ["src", "tests"]
106-
check_untyped_defs = true
107-
disallow_incomplete_defs = true
108-
disallow_untyped_calls = true
109-
disallow_untyped_decorators = true
110-
disallow_untyped_defs = true
111-
no_implicit_optional = true
112-
warn_redundant_casts = true
113-
warn_return_any = true
114-
warn_unreachable = true
115-
warn_unused_ignores = true
102+
[tool.ty.environment]
103+
python-version = "3.10"
104+
105+
[tool.ty.src]
106+
include = ["src", "tests", "scripts", "docs", "website"]

0 commit comments

Comments
 (0)