Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__pycache__
.mypy_cache
.ty_cache
.pytest_cache
.ruff_cache

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ make format

### Type checking

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

To run type checking:

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type-check check-code format

clean:
rm -rf .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
rm -rf .ty_cache .pytest_cache .ruff_cache build dist htmlcov .coverage

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

type-check:
uv run mypy
uv run ty check

# The check-code target runs a series of checks equivalent to those performed by pre-commit hooks
# and the run_checks.yaml GitHub Actions workflow.
Expand Down
21 changes: 6 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dependencies = []
[dependency-groups]
dev = [
"dycw-pytest-only~=2.1.0",
"mypy~=1.17.0",
"pre-commit~=4.3.0",
"pytest-asyncio~=1.1.0",
"pytest-cov~=6.2.0",
Expand All @@ -53,7 +52,7 @@ dev = [
"pytest~=8.4.0",
"ruff~=0.12.0",
"setuptools", # setuptools are used by pytest, but not explicitly required

"ty~=0.0.0",
]

[tool.ruff]
Expand Down Expand Up @@ -100,16 +99,8 @@ asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
timeout = 300

[tool.mypy]
python_version = "3.10"
files = ["src", "tests"]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_ignores = true
[tool.ty.environment]
python-version = "3.10"

[tool.ty.src]
include = ["src", "tests", "scripts", "docs", "website"]
Loading