-
Notifications
You must be signed in to change notification settings - Fork 4
Added type annotations. #13
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 have a problem with line 77. I need to add a tuple of objects of type Any, but can't make it work. The error now is: File "/home/runner/work/Adafruit_CircuitPython_MS8607/Adafruit_CircuitPython_MS8607/adafruit_ms8607.py", line 77, in CV Error: Process completed with exit code 2. Related question: pre-commit doesn't give me any error on my computer. I only encounter this error after pushing to GitHub. Is it possible to get the exact same error messages locally before pushing to GitHub? Maybe I'm doing something wrong. |
My first guess for the error:
Would be that With regards to getting set up to see the same errors locally. The learn guide page here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code and the 2 pages that follow it cover the setup for Once you get them set up locally you can run them with a command like:
and it will do all of the checks in your local instance and output any warnings or errors. |
Thanks for your quick reply @FoamyGuy ! Unfortunately, Any is imported and I still got the error. Actually, I've been using pre-commit for a while and always check the files with it locally before committing. My problem is that the tests run without errors locally, so I commit, and then sometimes the 'GitHub version' of the tests throws errors, like the above one with the unknown Any NameError. I don't get this error when running pre-commit locally on my machine. |
I'm still having problems with plain module imports (ModuleNotFound errors). Currently, I get the following output:
Error: reformatted adafruit_ms8607.py All done! ✨ 🍰 ✨ reuse....................................................................Passed And also: I really ran out of ideas. Can you help out @FoamyGuy ? Thanks! |
Sorry for the delay, this one got lost for me. Unfortunately I don't really recognize the errors you posted:
The bit further up in the output about the Black formatting is expected output though. It means that Black did some reformatting and now the resulting changes need to be committed. I've run this locally now and will make a new commit with those changes. |
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.
The latest version looks good to me after the code formatting.
Thanks for working on this @sdomoszlai13!
If you are still having issues when you run pre-commit locally you can try to get help on our discord as well.
Updating https://github.com/adafruit/Adafruit_CircuitPython_MS8607 to 1.0.19 from 1.0.18: > Merge pull request adafruit/Adafruit_CircuitPython_MS8607#13 from sdomoszlai13/type_annotations Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD4X to 1.4.0 from 1.3.9: > Merge pull request adafruit/Adafruit_CircuitPython_SCD4X#7 from KeithTheEE/add_one_shot_co2 Updating https://github.com/adafruit/Adafruit_CircuitPython_ServoKit to 1.3.15 from 1.3.14: > Merge pull request adafruit/Adafruit_CircuitPython_ServoKit#49 from spovlot/fix-i2c-doc Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Added requested type annotations to adafruit_ms8607.py. Please take a look, @FoamyGuy .