@@ -102,7 +102,6 @@ dev = [
102102 " build<2.0.0" , # For e2e tests.
103103 " dycw-pytest-only<3.0.0" ,
104104 " fakeredis[probabilistic,json,lua]<3.0.0" ,
105- " mypy~=1.19.0" ,
106105 " pre-commit<5.0.0" ,
107106 " proxy-py<3.0.0" ,
108107 " pydoc-markdown<5.0.0" ,
@@ -113,6 +112,7 @@ dev = [
113112 " pytest<9.0.0" ,
114113 " ruff~=0.14.0" ,
115114 " setuptools" , # setuptools are used by pytest, but not explicitly required
115+ " ty~=0.0.0" ,
116116 " types-beautifulsoup4<5.0.0" ,
117117 " types-cachetools<7.0.0" ,
118118 " types-colorama<1.0.0" ,
@@ -230,62 +230,24 @@ filterwarnings = [
230230 " ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning" ,
231231]
232232
233- [tool .mypy ]
234- python_version = " 3.10"
235- plugins = [" pydantic.mypy" ]
233+ [tool .ty .environment ]
234+ python-version = " 3.10"
235+
236+ [tool .ty .src ]
237+ include = [" src" , " tests" , " scripts" , " docs" , " website" ]
236238exclude = [
237239 " src/crawlee/project_template" ,
238240 " docs/guides/code_examples/storage_clients/custom_storage_client_example.py" ,
239241]
240- files = [" src" , " tests" , " docs" , " website" ]
241- check_untyped_defs = true
242- disallow_incomplete_defs = true
243- disallow_untyped_calls = true
244- disallow_untyped_decorators = true
245- disallow_untyped_defs = true
246- no_implicit_optional = true
247- warn_redundant_casts = true
248- warn_return_any = true
249- warn_unreachable = true
250- warn_unused_ignores = true
251-
252- [[tool .mypy .overrides ]]
253- # Example codes are sometimes showing integration of crawlee with external tool, which is not dependency of crawlee.
254- module = [
255- " apify" , # Example code shows integration of apify and crawlee.
256- " apify_fingerprint_datapoints" , # Untyped and stubs not available
257- " camoufox" , # Example code shows integration of camoufox and crawlee.
258- " fastapi" , # Example code shows running in webserver.
259- " saxonche" , # Example code shows HttpCrawler with custom parser.
260- " scrapling.*" , # Example code shows HttpCrawler with custom parser.
261- " selectolax.*" , # Example code shows HttpCrawler with custom parser.
262- " stagehand.*" , # Example code shows integration of Stagehand and crawlee.
263- " starlette.*" , # Example code shows running in webserver.
264- " flask" , # Example code shows deploy on Google Cloud.
265- " functions_framework" , # Example code shows deploy on Google Cloud.
266- " jaro" , # Untyped and stubs not available
267- " litestar" , # Example code shows deploy on Google Cloud Run.
268- " loguru" , # Example code shows integration of loguru and crawlee for JSON logging.
269- " lxml.*" , # Example code shows HttpCrawler with custom parser.
270- " sklearn.linear_model" , # Untyped and stubs not available
271- " cookiecutter.*" , # Untyped and stubs not available
272- " inquirer.*" , # Untyped and stubs not available
273- " pyquery" , # Example code shows HttpCrawler with custom parser.
274- " warcio.*" , # Example code shows WARC files creation.
275- " wrapt" # Untyped and stubs not available
276- ]
277- ignore_missing_imports = true
278242
279- [[tool .mypy .overrides ]]
280- module = [
281- " running_in_web_server.*" , # False positive when fastapi not available
243+ [[tool .ty .overrides ]]
244+ include = [
245+ " docs/**/*.py" ,
246+ " website/**/*.py" ,
282247]
283- disable_error_code = [" misc" ]
284248
285- [tool .basedpyright ]
286- pythonVersion = " 3.10"
287- typeCheckingMode = " standard"
288- include = [" src" , " tests" , " docs" , " website" ]
249+ [tool .ty .overrides .rules ]
250+ unresolved-import = " ignore"
289251
290252[tool .coverage .report ]
291253exclude_lines = [" pragma: no cover" , " if TYPE_CHECKING:" , " assert_never()" ]
0 commit comments