lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.39k stars 330 forks source link

Integrate mypy #263

Closed sobolevn closed 6 years ago

sobolevn commented 6 years ago

When #258 will be ready the next step is to integrate mypy.

There is a standalone script. And there's a plugin for pytest, but I have not used it yet. https://pypi.python.org/pypi/pytest-mypy

lk-geimfari commented 6 years ago

@sammyshj Excellent. It will be awesome!

lk-geimfari commented 6 years ago

@sobolevn Unfortunately, the solution with pytest-mypy works slowly... too slowly: 3m 42s 840ms

lk-geimfari commented 6 years ago

Also it's doesn't support mypy.ini file. It's a problem.

lk-geimfari commented 6 years ago

I think that i'll rewrite plugin especially for us.

sobolevn commented 6 years ago

@lk-geimfari this plugin is not production ready, that's true. But maybe you should help with its development instead of rewriting it?

lk-geimfari commented 6 years ago

@sobolevn Of course, I'll write to the author and if he agrees, I'll work on current plugin. Rewriting is an extreme measure.

lk-geimfari commented 6 years ago

@sobolevn How should we check types? Should we check types with usual tests or after ones?

Let me illustrate ideas:

py.test --verbose --color=yes --mypy mimesis ./

or

make test # 
make type-check #

The problem with co-testing is that mypy takes a considerable amount of time.

sobolevn commented 6 years ago

What's the timings for tests and type checking?

lk-geimfari commented 6 years ago

@sobolevn I have run py.test 7 minutes ago and testing still going.

UPD: Testing took 12 minutes.

sobolevn commented 6 years ago

mypy must be way faster. So, it is easier to run fast tests first, then slow tests. I will also open a new issue to optimize tests speed.

lk-geimfari commented 6 years ago

Fixed in #299