Support music_pb2 / generator_pb2 type checking#62
Support music_pb2 / generator_pb2 type checking#62atsukoba wants to merge 2 commits intomagenta:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Thank you for pointing this out! I just noticed that the latest version of protoc natively supports pyi outputs, so I think we'll prefer to stick with that. I'm working on a PR for it and should have it committed soon: #63 |
|
@atsukoba I release a new pip package of note-seq, but I think the type hints weren't included in the new package. Can you verify if the hints are working for you, and if not, would you mind looking into what modifications are needed to setup.py to include them? |
|
@cghawthorne Thank you for your commit and release. I confirmed that the new release ( for example, we can add the arg below to track stub files in the package. # setup.py
setup(
name='note-seq',
...,
package_data={"note_seq": ["*.pyi", "**/*.pyi"]}
)How about trying that? |
|
Thanks! Could you try v0.0.5 of the pip package? Hopefully that solves it! |
|
@cghawthorne Thank you for updating pip package. I checked |
Generated python files had no type information so users who use modules under
note_seq.protobufwith type checker likemypyneed to add lots of comments to make lines be ignored by type checkers. I addedpyistub files without changing module codes with several protobuf packages listed in/note_seq/protobuf/README.md. It should helps users useNoteSequencemore comfortably and make full use of NoteSequence functions and representations in practical and creative music application!mypy-protobufis not tested withprotobuf==3.6.1but it worked. I confirmed some type checker outputs with offiial sample snippet like below.Before
After