Skip to content

Commit f36ecea

Browse files
committed
Use ty instead of mypy
1 parent 5124e4b commit f36ecea

7 files changed

Lines changed: 148 additions & 179 deletions

File tree

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ jobs:
3838
- name: Check code quality
3939
run: uv run ruff check .
4040
- name: Check typing
41-
run: uv run mypy
41+
run: uv run ty check

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![PyPI - Version](https://img.shields.io/pypi/v/viracitapada?logo=pypi&logoColor=%23ffffff&color=%230073b7)](https://pypi.org/project/viracitapada)
44
![Tests Status](https://img.shields.io/github/actions/workflow/status/VedaWebProject/viracitapada/tests.yml?label=tests)
55
[![Tests Coverage](https://img.shields.io/coverallsCoverage/github/VedaWebProject/viracitapada?branch=main&label=tests%20coverage)](https://coveralls.io/github/VedaWebProject/viracitapada?branch=main)
6-
![mypy](https://img.shields.io/badge/type%20checked-mypy-039dfc)
6+
![ty](https://img.shields.io/badge/type%20checked-ty-039dfc)
77

88

99
Performs metrical analysis on ISO-15919-transliterated Sanskrit verses.

pre-commit.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
!#!/usr/bin/env sh
22

3+
set -e
4+
35
# Format code and fix linter errors
46
uv run ruff format .
57
uv run ruff check . --fix
@@ -8,11 +10,11 @@ uv run ruff check . --fix
810
uv run ruff format . --check
911
uv run ruff check .
1012

11-
# run mypy
12-
uv run mypy
13-
1413
# Run tests and measure test coverage
1514
uv run coverage run -m pytest
1615

1716
# Print coverage report of last measured test run
1817
uv run coverage report -m
18+
19+
# run ty
20+
uv run ty check

pyproject.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,11 @@ build-backend = "hatchling.build"
3939
[dependency-groups]
4040
dev = [
4141
"coverage>=7.6.9",
42-
"mypy>=1.13.0",
4342
"pytest>=8.3.4",
4443
"ruff>=0.8.3",
44+
"ty>=0.0.56",
4545
]
4646

47-
# mypy
48-
49-
[tool.mypy]
50-
python_version = "3.10"
51-
files = "src/viracitapada/**/*.py"
52-
warn_return_any = true
53-
5447
# ruff
5548

5649
[tool.ruff]

tests/test_annotate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ def test_annotate_type_error():
4141
"yahvā́ iva",
4242
1,
4343
True,
44-
]
44+
] # ty:ignore[invalid-argument-type]
4545
)

tests/test_parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_parse_custom_marks():
3030

3131
def test_parse_invalid_type():
3232
with pytest.raises(TypeError):
33-
vp.parse_meter(False)
33+
vp.parse_meter(False) # ty:ignore[invalid-argument-type]
3434

3535

3636
def test_parse_lines_multiline_str(
@@ -63,5 +63,5 @@ def test_parse_type_error():
6363
"yahvā́ iva",
6464
1,
6565
True,
66-
]
66+
] # ty:ignore[invalid-argument-type]
6767
)

uv.lock

Lines changed: 137 additions & 163 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)