Type annotations for celery/apps/beat.py#8108
Conversation
* Annotate text * fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix * fix * Add to pyproject * Fix * remove comment * Small fix * remove comment * remoev unused arg * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix * fix * build fix * type fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * pytest==7.2.2 (celery#8106) * Fix * Fix * Type checking fix * Update celery/utils/text.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #8108 +/- ##
==========================================
- Coverage 87.02% 87.01% -0.01%
==========================================
Files 148 148
Lines 18445 18449 +4
Branches 2515 2515
==========================================
+ Hits 16051 16054 +3
- Misses 2116 2118 +2
+ Partials 278 277 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
celery/apps/beat.py
Outdated
| ) | ||
|
|
||
| def install_sync_handler(self, service): | ||
| def install_sync_handler(self, service: Service) -> None: |
There was a problem hiding this comment.
Pre-commit was replacing quoted type hints. Is this intended? I think it would be useful to allow them, so that I could conditionally import types with if TYPE_CHECKING.
|
The CI was stuck - on it |
for more information, see https://pre-commit.ci
Hmm, not able to replicate locally. Do you have any debugging advice? Never really seen a CI just get stuck. |
Tbh "stuck" isn't accurate, it was pending/waiting due to a time limit if I'm not mistaken. I've stopped the run and will re-run soon. It should allow everything to run smoothly. |
|
I see, thanks!
…On Sun, Mar 5, 2023 at 2:07 PM Tomer Nosrati ***@***.***> wrote:
The CI was stuck - on it
Hmm, not able to replicate locally. Do you have any debugging advice?
Never really seen a CI just get stuck.
Tbh "stuck" isn't accurate, it was pending/waiting due to a time limit if
I'm not mistaken.
I've stopped the run and will re-run soon. It should allow everything to
run smoothly.
—
Reply to this email directly, view it on GitHub
<#8108 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJZZWA5R7IGCTVUYD7XLV3DW2TW7TANCNFSM6AAAAAAVQKIHBQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Thank You friend! And don't worry, I got my eyes on the CI. If something happens I'll comment/fix etc. |
celery/apps/beat.py
Outdated
| def app(self) -> Celery: | ||
| if self._app: | ||
| return self._app | ||
| raise ValueError("Beat must provided a Celery app.") |
There was a problem hiding this comment.
Added lines #L83 - L84 were not covered by tests
Can you add a unit test for this please?
There was a problem hiding this comment.
Fixed a type hint (scheduler/scheduler_cls), and added a test that covers both.
There was a problem hiding this comment.
I seem to have some trouble running unit tests locally, pytest must be caching (or something else, not sure) as the new field on the Beat class isn't even picked up when inspecting with pdb. Do you have any ideas here?
celery/apps/beat.py
Outdated
|
|
||
| @app.setter | ||
| def app(self, app: Celery) -> None: | ||
| self._app = app |
There was a problem hiding this comment.
Added line #L88 was not covered by tests
Can you add a unit test for this please?
for more information, see https://pre-commit.ci
|
@Nusnus Modified it a way that doesn't require a setter/getter so removed the test, if you want to take another look. It turns out there was no need to explicitly set the |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci

Note: Before submitting this pull request, please review our contributing
guidelines.
Description
Type annotations for
celery/apps/beat.pyas a part of #7394.