ci: add Pyrefly type validation/code coverage and bug fixes#410
Open
danudey wants to merge 7 commits into
Open
ci: add Pyrefly type validation/code coverage and bug fixes#410danudey wants to merge 7 commits into
danudey wants to merge 7 commits into
Conversation
Owner
|
Thanks for all the fixes! Can you resolve the conflict? I think there may also be some syntaxes that need to be changed for older python versions, I try to maintain support for all versions still getting official security updates. Feel free to ignore 3.9 though, support for that version ends this month. |
Contributor
Author
|
Sounds good, I'll switch over to testing with 3.10 then and see if anything needs fixing then update the branch again. |
fdc93ec to
10c4be0
Compare
a422bda to
549e095
Compare
Contributor
Author
|
@newAM A bunch of updates in this PR, outside of the original scope. Let me know if you want me to split this off to preserve context. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pyrefly is a new, incredibly fast, type checker written in Rust by Meta. This PR adds pyrefly as a check, and also fixes all the existing issues it finds.
A few notes:
Edit
Was working on expanding code coverage and found (well, Claude found) two pre-existing bugs that were easy to fix:
In
LinuxVCP.rate_limt, the delay is computed asrate_delay = self.CMD_RATE - time.time() - self.last_set, whichtakes the 50ms constant and subtracts the last-set timestamp and the value of
time.time(), meaning it's always negative. Simple parenthesis change fixed.Also,
LinuxVCP.write_bytes, in the missing file descriptor branch we create theVCPIOError("unable write to I2C bus: no open file descriptor found")exception but we don't actuallyraiseit. Another simple fix.Wanted to fix these so that new unit tests wouldn't end up testing invalid behavior and then require fixing in a separate PR.
On top of this, added a bunch of code coverage (as mentioned) for linux_vcp.py; if this feels too far out of scope for this PR, I can refactor it out.