Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
darrenburns opened this issue Jun 10, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@darrenburns
Copy link
Owner

darrenburns commented Jun 10, 2021

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.

@darrenburns darrenburns added enhancement New feature or request good first issue Good for newcomers labels Jun 10, 2021
@darrenburns darrenburns changed the title Update type annotations, make Ward pass mypy Update type annotations, make Ward pass mypy, distribute type annotations via PEP561 Jun 10, 2021
@hukkin
Copy link
Contributor

hukkin commented Jun 10, 2021

#265 is the first but not final step here

@hukkin
Copy link
Contributor

hukkin commented Jul 9, 2021

The only thing that remains to be done now is the TODO: in pyproject.toml

# TODO: Remove these lines and fix type-checker errors to gradually introduce mypy

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

@AABur
Copy link
Contributor

AABur commented Apr 11, 2022

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

@edmorley
Copy link

edmorley commented Nov 3, 2022

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.

vrslev added a commit to vrslev/ward that referenced this issue Dec 3, 2022
Currently type information in API is not complete. It makes it hard to use the library with mypy's strict mode and Pyright.

Also see: darrenburns#261 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants
@edmorley @hukkin @darrenburns @AABur and others