Skip to content

Type annotations for celery/utils/text.py#8107

Merged
auvipy merged 27 commits intocelery:mainfrom
max-muoto:annotate
Mar 5, 2023
Merged

Type annotations for celery/utils/text.py#8107
auvipy merged 27 commits intocelery:mainfrom
max-muoto:annotate

Conversation

@max-muoto
Copy link
Copy Markdown
Contributor

@max-muoto max-muoto commented Mar 4, 2023

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

Type annotations for celery/utils/text.py as a part of #7394.

@max-muoto max-muoto marked this pull request as ready for review March 4, 2023 17:58
kw: Any) -> str:
"""Format value for printing to console."""
if isinstance(value, dict):
return f'{{{sep} {pformat(value, 4, nl_width)[1:]}'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Syntax error here.

@Nusnus
Copy link
Copy Markdown
Member

Nusnus commented Mar 4, 2023

There are some issues with the CI so the tests aren't running correctly.
I will handle this soon, FYI

@max-muoto
Copy link
Copy Markdown
Contributor Author

There are some issues with the CI so the tests aren't running correctly. I will handle this soon, FYI

Sounds good, thanks!

@Nusnus
Copy link
Copy Markdown
Member

Nusnus commented Mar 4, 2023

@Nusnus
Copy link
Copy Markdown
Member

Nusnus commented Mar 4, 2023

      def join(l: list[str], sep: str = '\n') -> str:
  E   TypeError: 'type' object is not subscriptable```

@max-muoto
Copy link
Copy Markdown
Contributor Author

      def join(l: list[str], sep: str = '\n') -> str:
  E   TypeError: 'type' object is not subscriptable```

My bad there, just fixed!

@Nusnus
Copy link
Copy Markdown
Member

Nusnus commented Mar 4, 2023

ERROR t/unit/bin/test_beat.py - NameError: name 'Match' is not defined
ERROR t/unit/bin/test_worker.py - NameError: name 'Match' is not defined

@max-muoto
Copy link
Copy Markdown
Contributor Author

max-muoto commented Mar 5, 2023

ERROR t/unit/bin/test_beat.py - NameError: name 'Match' is not defined
ERROR t/unit/bin/test_worker.py - NameError: name 'Match' is not defined

Ah forgot to quote that, as it should be since it's conditionally imported if type checking is enabled. Fixed.

Having trouble with tox for some reason when trying to test, it just hangs on the pip install steps.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2023

Codecov Report

Patch coverage: 96.15% and no project coverage change

Comparison is base (7829247) 87.02% compared to head (8a0739f) 87.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8107   +/-   ##
=======================================
  Coverage   87.02%   87.02%           
=======================================
  Files         148      148           
  Lines       18444    18445    +1     
  Branches     2515     2515           
=======================================
+ Hits        16050    16051    +1     
  Misses       2116     2116           
  Partials      278      278           
Flag Coverage Δ
unittests 86.99% <96.15%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
celery/utils/text.py 90.90% <96.15%> (+0.10%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@auvipy auvipy added this to the 5.3 milestone Mar 5, 2023
@Nusnus Nusnus self-requested a review March 5, 2023 08:11
@auvipy auvipy merged commit 32a83e2 into celery:main Mar 5, 2023
max-muoto added a commit to max-muoto/celery that referenced this pull request Mar 5, 2023
* 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>
auvipy added a commit that referenced this pull request Mar 9, 2023
* Type annotations

* small change

* unused import

* Type annotations for `celery/utils/text.py` (#8107)

* 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 (#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>

* Pre-commit fix

* value error change

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Unit test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Comment fix

* Fix

* Future import

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert

* format fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update celery/apps/beat.py

---------

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants