Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support type hints and mypy #216

Closed
altendky opened this issue Jul 8, 2020 · 1 comment · Fixed by #337
Closed

Support type hints and mypy #216

altendky opened this issue Jul 8, 2020 · 1 comment · Fixed by #337
Assignees
Milestone

Comments

@altendky
Copy link
Contributor

altendky commented Jul 8, 2020

I am just starting into this but figured I'd get a ticket in sooner than later. Hopefully supporting type hints requires pretty minimal effort in qtpy since it is just (primarily?) a pass through library. I have had at least preliminary success by adding a py.typed file and then using mypy's --always-true and --always-false to set PYSIDE2 and PYQT5 variables as they need to be for the library I am interested in. I imagine giving qtpy a cli such that you could call env/bin/mypy --target yourlib $(env/bin/qtpy mypyargs) and the qtpy cli would generate the proper mypy arguments based on the regular library selection code. For the sake of allowing mypy runs to really be static I would expect to also document everything to set and allow generation of args via the cli based on a forced library like env/bin/qtpy mypyargs --use pyside2 or such.

Opinions? What sort of target would I have to hit to have a PR for this ready for the next release?

@altendky
Copy link
Contributor Author

altendky commented Jul 9, 2020

Or maybe a mypy plugin could do this and would make more sense? I'll have to look into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants