-
Notifications
You must be signed in to change notification settings - Fork 40
Roadmap to 1.0 commits #116
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
Conversation
I think (if this is good) it can wait a couple of months before being merged (to make fixing any 0.14.0 bugs easier). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! Finally we can make use of all the fancy shiny new python features 👍 🎉
I just have a few minor style questions.
0c7b0bd
to
c465c26
Compare
Python 2 will reach end of life on 2020-01-01, before then wsproto will be released dropping Python 2 as progress is made towards a 1.0 release. The UTF-8 Validator isn't required with Python 3 which can do the same via the decode.
This allows for dataclasses to be used (backport for 3.6 exists, but not 3.5) it also allows for the usage of PEP 526 variable annotations in the upcoming typing commit. 3.6.1 Introduces typing for Deque which will be required to type hint the codebase. Sadly PyPy CI has had to be removed as Travis has no PyPy3.6 support yet (although the testing did very little due to performance concerns, see tox.ini).
Now that wsproto supports Python 3.6 or greater dataclasses can be used. Doing so utilises a standard system (rather than the previous bespoke version) for building these Event classes which then allows other tools, such as mypy, to understand the structure of the events.
This fully type hints the wsproto codebase and uses mypy to ensure the type hints are added and correct. This has identified some potential bugs, see 582d052 The additional linting disable is because the mypy TYPE_CHECKING is not understood by pylint.
This should allow the typing included with wsproto to be picked up by mypy and used in projects that use wsproto.
@pgjones whats the progress here? |
This is good to merge, I was planning to wait another month before doing so - I'm happy to merge though if you are. |
Includes dropping Python 2.7, 3.5 and introducing typing.