qa: fix ty caching and align CI with local run#46278
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Cherry of danyalahmed1995:fix/46170-device-mesh-import-guard, applied as a base so this branch can be rebased onto main once #46205 lands (it will then drop out as a duplicate).
c2e896f to
b6bb7f9
Compare
|
[DONE] now picks the change from #46205 so the changes on |
| # previously clean `types` run can be reused from cache. | ||
| # Approximate: ty follows imports beyond the listed directories; these globs cover | ||
| # the explicitly targeted paths but not transitive dependencies. | ||
| # ty follows imports *beyond* the checked roots, so the cache key must cover every source file |
There was a problem hiding this comment.
but the scope is always within src/transformers, right? i.e. it will never go beyond this?
There was a problem hiding this comment.
yes, but we check a subset of the files in that directory with our set up.
the change makes sure that we bust the cache in case ANY file has changed because it can indirectly impact the ty call.
| # `make typing` and CI both pass and the issue is never caught before commit. | ||
| result = subprocess.run( | ||
| ["ty", "check", "--respect-ignore-files", "--exclude", "**/*_pb*", *directories], | ||
| ["ty", "check", "--respect-ignore-files", "--error-on-warning", "--exclude", "**/*_pb*", *directories], |
There was a problem hiding this comment.
Locally, we have this --error-on-warning but not on current CI ??
Or I misunderstand the inconsistency you described?
I noticed make typing was failing locally but the ty checker was green in CI. This happened because the CI run did not error on warnings.
There was a problem hiding this comment.
it was a combination:
- no error on warnings
- the local can have more packages installed : torch, torchvision, etc
the combo made the two environments behave differently when warnings where triggered.
There was a problem hiding this comment.
it's done in the other PR that got merged. I have just rebased so its gone from this one
What does this PR do?
I noticed
make typingwas failing locally but the ty checker was green in CI. This happened because the CI run did not error on warnings.There was also a bug in how we cache calls: when Ty was failing via make typing, the next cached call was appearing green because it was not busting the cache when ty errored out.
This patch fixes those discrepancies