opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

[FEATURE] Add mypy coverage outside fo opensearchpy/* #564

Closed dblock closed 10 months ago

dblock commented 10 months ago

Is your feature request related to a problem?'

Coming from #563 where we merged type stubs. Add type coverage for tests, benchmarks, etc.

What solution would you like?

Edit noxfile, fix type errors.

+++ b/noxfile.py
@@ -82,7 +82,7 @@ def lint(session) -> None:

     # Run mypy on the package and then the type examples separately for
     # the two different mypy use-cases, ourselves and our users.
-    session.run("mypy", "--strict", "opensearchpy/")
+    session.run("mypy", "--strict", *SOURCE_FILES)
     session.run("mypy", "--strict", "test_opensearchpy/test_types/sync_types.py")
     session.run("mypy", "--strict", "test_opensearchpy/test_types/async_types.py")
dblock commented 10 months ago

Current state of https://github.com/dblock/opensearch-py/tree/rest-of-mypy

$ nox -rs format 

Found 237 errors in 61 files (checked 221 source files)
nox > Command mypy --strict setup.py noxfile.py opensearchpy/ test_opensearchpy/ utils/ samples/ benchmarks/ docs/ failed with exit code 1