mutagen icon indicating copy to clipboard operation
mutagen copied to clipboard

Add type annotations

Open jtpavlock opened this issue 4 years ago • 6 comments

Any thought to adding type annotations so those using Mutagen can take advantage of mypy static type checking?

jtpavlock avatar Aug 16 '20 00:08 jtpavlock

All for it. I'll look into adding mypy to CI for starters, so it's easier to review changes.

btw, I think we can start requiring 3.6 if it makes things easier, not sure if it does.

lazka avatar Aug 16 '20 09:08 lazka

I think we can start requiring 3.6 if it makes things easier, not sure if it does.

Definitely not a deal breaker, but I think the only difference is 3.5 doesn't support variable annotations.

jtpavlock avatar Aug 16 '20 13:08 jtpavlock

variable annotations would be nice.

@phw is bumping to Python 3.6 OK with you?

There are ~90 mypy errors currently. I guess we have to fix/ignore them before we can test this in CI.

lazka avatar Aug 19 '20 07:08 lazka

Yes, I think 3.6 would be ok from Picard side.

Ubuntu 16.04 is using Python 3.5, this is something that could be considered. But from our side this is not a concern, we have other dependency issues with that old Ubuntu LTS. And I think it is just fair to stick with current mutagen version if a project really needs backward compatibility with Python < 3.6.

phw avatar Aug 19 '20 09:08 phw

Thanks, done in #487

lazka avatar Aug 19 '20 16:08 lazka

See #488 for mypy

lazka avatar Aug 19 '20 18:08 lazka