kaste / mockito-python

Mockito is a spying framework
MIT License
123 stars 12 forks source link

Mypy integration #58

Open mazinesy opened 2 years ago

mazinesy commented 2 years ago

Related: https://github.com/kaste/mockito-python/issues/27

👋 We currently are using mockito-python but checks are failing when running mypy.

Here's the output:

error: Skipping analyzing "mockito": module is installed, but missing library stubs or py.typed marker
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

Is there an easy to make this work ?

kaste commented 2 years ago

The easy way is to ignore mockito, e.g. something like this in mypy.ini.

[mypy-mockito]
ignore_missing_imports = True

Full typing support would be some significant work. What do you actually expect here?

mazinesy commented 2 years ago

Yep, that's exactly what we currently are doing.

What do you actually expect here?

Nothing much really. It just is an issue to track the typing as it is becoming more and more popular.

kaste commented 2 years ago

Funny enough, we actually run mypy here as a GitHub action.

https://github.com/kaste/mockito-python/blob/9c56559cd376d131e2db3510ad165142250272f2/.github/workflows/test-lint-go.yml#L64-L78