Closed cdragos closed 1 month ago
Why pyright instead of mypy? I don't have strong opinions on which one is better, but I don't like to change tools without good reasons.
I'm happy we now have type checking, but I don't think changing tools will improve it a lot. I prefer to keep iterating on mypy config and enable many options still disabled.
@iurisilvio Thanks for your feedback. I apologize for not providing a description earlier.
I agree about being cautious with changing tools. While exploring pyright
, I found it caught several issues with its default settings that the current setup missed:
raise ("Model URL must be from either app.roboflow.com or universe.roboflow.com")
r = check_key(api_key)
where the function signature doesn't matchdef train(..) -> bool:
where the actual return type differsOne feature I found particularly useful is pyright's Inferred Return Types, similar to TypeScript. Unlike mypy
, which marks unannotated return types as Any
, pyright provides the actual return type.
Many more differences documented here made me think pyright
is a better tool.
To move forward, I propose the following alternatives:
mypy
and some changes / fixes
from my PRLet me know what you think!
I prefer to not add a new tool now. There is a lot of work improving mypy behaviour and another tool will split efforts with small gains. Can you go with option 2?
@iurisilvio Thank you for your thorough feedback and guidance throughout this PR process. I've addressed all the comments raised. 🏄🏼
Thanks! 🚢
This PR enhances our code quality checks and type safety:
check_code_quality
processpathlib.Path
for better cross-platform support.dockerignore