Skip to content

Commit 3995f46

Browse files
committed
feat: use ty instead of mypy
[ty](https://docs.astral.sh/ty/) is a modern replacement of mypy written in Rust. Even though it is still in Beta, it is almost ready for production. Therefore, there is nothing blocking us from giving it a chance. JIRA: TRIVIAL risk: low
1 parent 456a68c commit 3995f46

File tree

25 files changed

+76
-191
lines changed

25 files changed

+76
-191
lines changed

.github/workflows/rw-python-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ jobs:
5252
- name: Install dependencies
5353
run: |
5454
uv sync --only-group tox --only-group type
55-
- name: mypy check
55+
- name: type check
5656
run: |
57-
make mypy
57+
make type-check

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ download:
6767
$(call download_client,"export")
6868
$(call download_client,automation)
6969

70-
.PHONY: mypy
71-
mypy:
70+
.PHONY: type-check
71+
type-check:
7272
RESULT=0; \
73-
for project in $(NO_CLIENT_GD_PROJECTS_DIRS); do $(MAKE) -C packages/$${project} mypy || RESULT=$$?; done; \
73+
for project in $(NO_CLIENT_GD_PROJECTS_DIRS); do $(MAKE) -C packages/$${project} type-check || RESULT=$$?; done; \
7474
exit $$RESULT
7575

7676
.PHONY: types
77-
types: mypy
77+
types: type-check
7878

7979
.PHONY: test
8080
test:

packages/gooddata-dbt/mypy.ini

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/gooddata-dbt/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ type = [
4444
"pydantic~=2.12.0",
4545
]
4646

47+
[tool.ty.analysis]
48+
allowed-unresolved-imports = ["deep_translator", "github"]
49+
4750
[tool.hatch.build.targets.wheel]
4851
packages = ["src/gooddata_dbt"]
4952

packages/gooddata-dbt/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ setenv =
1313
commands =
1414
pytest -v --cov=src/gooddata_dbt --cov-report=xml tests {posargs}
1515

16-
[testenv:mypy]
16+
[testenv:type-check]
1717
runner = uv-venv-lock-runner
1818
skip_install = true
1919
dependency_groups =
2020
type
2121
commands =
22-
mypy src/gooddata_dbt
22+
uv run ty check src/gooddata_dbt

packages/gooddata-fdw/mypy.ini

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/gooddata-fdw/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ type = [
6262
"pydantic~=2.12.0",
6363
]
6464

65+
[tool.ty.analysis]
66+
allowed-unresolved-imports = ["multicorn"]
67+
6568
[tool.hatch.build.targets.wheel]
6669
packages = ["src/gooddata_fdw"]
6770

packages/gooddata-fdw/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ setenv =
1313
commands =
1414
pytest -v --cov=src/gooddata_fdw --cov-report=xml tests {posargs}
1515

16-
[testenv:mypy]
16+
[testenv:type-check]
1717
runner = uv-venv-lock-runner
1818
skip_install = true
1919
dependency_groups =
2020
type
2121
commands =
22-
mypy src/gooddata_fdw
22+
uv run ty check src/gooddata_fdw
2323

2424
[testenv:docs]
2525
basepython = python3.14

packages/gooddata-flexconnect/mypy.ini

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/gooddata-flexconnect/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ type = [
6464
"pydantic~=2.12.0",
6565
]
6666

67+
[tool.ty.analysis]
68+
allowed-unresolved-imports = ["jsonschema.**", "referencing"]
69+
6770
[tool.hatch.build.targets.wheel]
6871
packages = ["src/gooddata_flexconnect"]
6972

0 commit comments

Comments
 (0)