darrenburns / ward

Ward is a modern test framework for Python with a focus on productivity and readability.
https://ward.readthedocs.io
MIT License
1.21k stars 53 forks source link

Update type annotations, make Ward pass `mypy`, distribute type annotations via PEP561 #261

Open darrenburns opened 3 years ago

darrenburns commented 3 years ago

Type annotations have been used for the purpose of improving IDE code assistance so far.

MyPy has not been run, and this means that Ward currently does not pass type checking.

We should update the type annotations to ensure Ward passes mypy.

After this, we can add a build step to check the annotations on CI, and distribute the annotations via PEP561.

hukkin commented 3 years ago

https://github.com/darrenburns/ward/pull/265 is the first but not final step here

hukkin commented 3 years ago

The only thing that remains to be done now is the TODO: in pyproject.toml https://github.com/darrenburns/ward/blob/a4a0b7cb0a5f4728cdda7b870d01d9f26c6fd053/pyproject.toml#L98

I.e. a few private modules and tests are still not type checked.

AABur commented 2 years ago

@darrenburns, this issue has already been implemented a long time ago. However, it looks like it's time to close it.

edmorley commented 1 year ago

With pylance, I still get:

Type of "test" is partially unknown
  Type of "test" is "(description: str, *args: Unknown, tags: List[str] | None = None, **kwargs: Unknown) -> ((func: Unknown) -> (((*args: Unknown, **kwargs: Unknown) -> Unknown) | Unknown))"Pylance[reportUnknownVariableType](https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules)

For from ward import test.