Remove runtime conditions for type checking#37340
Remove runtime conditions for type checking#37340ArthurZucker merged 6 commits intohuggingface:mainfrom
Conversation
|
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the |
a314785 to
328bc1c
Compare
|
@cyyever if we remove the dynamic conditions for type checking, will this cause exceptions when those dependencies aren't present? |
There are wrapped in type_checking and used by linter, so that only linters would complain if there are missing symbols. |
ArthurZucker
left a comment
There was a problem hiding this comment.
Init are being heavily refactor #36827 would wait a bit!
|
@ArthurZucker what's the status here? I get the errors after the PR you mentioned landed as well. |
1ecb0f7 to
89a66e4
Compare
|
@ArthurZucker The CI failures are unrelated. |
|
sorry everyone I am not sure I understand what is the issue here / setup to reproduce? |
|
Happy to merge if this is compatible with the recent init refactoring! |
|
The rebase is quite recent |
97ccd93 to
f50b7de
Compare
Signed-off-by: cyy <cyyever@outlook.com>
|
@ArthurZucker just rebased it. |
|
@ydshieh have a look? |
|
@cyyever Got to say I am less familiar on this aspect 😅 . I see you answered
to @Rocketknight1 question
But I don't understand well:
Overall, I am open to merge, but we should resolve the case @Rocketknight1 mentioned at some point in the near future. |
|
Linters have to evaluate It depends on what linters are allowed to do, and I don't consider dynamic evaluation is generally supported. |
|
Is it possible to merge it? Because I have to recheck the changes in case init.py has more changes. |
|
Could we have some progress on this work because users are complaining about mypy... |
|
cc @ArthurZucker @Cyrilvallez the init refactor is done, I think this is ready for final review/approval! |
|
Can you check if the failing test is related or not? |
|
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. |
|
@ArthurZucker It is a test numerical error, not an import error, so it is unrelated. |
|
@ArthurZucker No failure |
|
Merging! |
|
Thanks 🤗 |
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Remove dynamic conditions for type checking Signed-off-by: cyy <cyyever@outlook.com> Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
What does this PR do?
Linters aren't smart enough to evaluate the conditions.
Fixes #37339