keleshev / schema

Schema validation just got Pythonic
MIT License
2.86k stars 214 forks source link

[Feature] Add type hints and mypy support #306

Closed qequ closed 8 months ago

qequ commented 10 months ago

Updated package so it's mypy compatible

Fixes #296

skorokithakis commented 10 months ago

Hello, thanks for this! Did you use Black on the code? If so, could you please add it to CI?

qequ commented 9 months ago

@skorokithakis I've added a CI job for check black linting :+1:

skorokithakis commented 9 months ago

This looks good, thank you! To speed up the review, is there any way you could make your changes to schema.py and not run Black on it? Then I can review only your changes, and I'll run Black and push to your PR, and then merge.

qequ commented 9 months ago

@skorokithakis tough I ran Black there are no significant changes made on the code by Black. At most there are three or four methods/functions signatures formatted to multiple lines, but most of the code remains unchanged

skorokithakis commented 9 months ago

Oh, all those changes are manual? OK, I will review ASAP, thanks!

qequ commented 9 months ago

@skorokithakis any updates on this?

skorokithakis commented 9 months ago

Sorry, this looks good to me. Which Python versions can run this? I worry that it uses syntax that's a bit too recent...

qequ commented 8 months ago

@skorokithakis I have made some updates and tested it up to python3.6 and works normally

skorokithakis commented 8 months ago

When you say "up to", what do you mean? 2.7 to 3.6? Surely it can't be 2.7-compatible any more.

qequ commented 8 months ago

@skorokithakis I've tested from 3.6 to 3.10 and works fine. 3.5 and backwards versions doesn't support types

skorokithakis commented 8 months ago

In that case, that's fine, but the setup.py classifiers/etc needs to be changed to the proper supported versions.

qequ commented 8 months ago

@skorokithakis updated classifiers