Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve Type Completeness #4466

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

Merged
merged 19 commits into from
Sep 14, 2024
Merged

Improve Type Completeness #4466

merged 19 commits into from
Sep 14, 2024

Conversation

Bibo-Joshi
Copy link
Member

Based on #4460 (comment)

The typing of CallbackContext got a tad less precise due to the Job[Any]. It appears that pyright wants us to use typing.Self (tried, it works with that), but that's available only in py3.11.

@Bibo-Joshi Bibo-Joshi added the ⚙️ type-hinting affected functionality: type-hinting label Sep 8, 2024
@Bibo-Joshi Bibo-Joshi requested a review from harshil21 September 8, 2024 19:04
the proper solution would be to make CH accept Sequences (covariant), but I ain't touching CH for this …
Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting that the score dropped like 2 months ago but we didn't notice it. Did the test fail and we merged it anyway?

@Bibo-Joshi
Copy link
Member Author

No, the problem is that the type completeness check has no memory across commits. So for each PR it needs to re-compute the type completeness of the head. so you have

  1. commit A, merged after testing with pyright 1.1.372, type score 1.0
  2. PR, comparing against commit A, recomputes with pyright 1.1.373, type score 0.976

If we wanted to catch these hases, we'd have to have something like codecov, i.e. a database for the type score per commit.
the upside of the current behavior is that a pyright update doesn't mark your PR as invalid even though your PR doesn't in itself decrease the type completeness …

@harshil21
Copy link
Member

@Bibo-Joshi I see. Can we not run a sanity check every month or so to see if the score dropped below 1.0?

@Bibo-Joshi
Copy link
Member Author

Don't know if I'm too tired or if the output is not set correctly by the reusable action. Will have to retry someday

@Bibo-Joshi
Copy link
Member Author

⇒ ready from my side :)

@Bibo-Joshi Bibo-Joshi merged commit 6b5e46c into master Sep 14, 2024
26 of 27 checks passed
@Bibo-Joshi Bibo-Joshi deleted the bump-type-completeness branch September 14, 2024 06:16
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚙️ type-hinting affected functionality: type-hinting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants