Skip to content

Add typing to Celery#7325

Closed
atombrella wants to merge 1 commit intocelery:masterfrom
atombrella:typing_annotations
Closed

Add typing to Celery#7325
atombrella wants to merge 1 commit intocelery:masterfrom
atombrella:typing_annotations

Conversation

@atombrella
Copy link
Copy Markdown
Contributor

This is a simple bootstrap of the process, adding some types to a
few selected functions, based on comment annotations. MyPy is chosen as the
default static analyzer for the types.

It's an attempt to solve #7258 Note that the work is quite demanding.

This is a simple bootstrap of the process, adding some types to a
few selected functions, based on comment annotations. MyPy is chosen as the
default static analyzer for the types.
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 28, 2022

Codecov Report

Merging #7325 (edd9dc4) into master (8423c67) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7325      +/-   ##
==========================================
- Coverage   89.33%   89.32%   -0.02%     
==========================================
  Files         138      138              
  Lines       16781    16781              
  Branches     2451     2451              
==========================================
- Hits        14991    14989       -2     
- Misses       1559     1561       +2     
  Partials      231      231              
Flag Coverage Δ
unittests 89.31% <100.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
celery/events/state.py 97.25% <100.00%> (ø)
celery/utils/collections.py 85.68% <100.00%> (ø)
celery/backends/asynchronous.py 68.83% <0.00%> (-0.87%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 095cd78...edd9dc4. Read the comment docs.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Feb 28, 2022

This pull request introduces 1 alert and fixes 2 when merging edd9dc4 into 095cd78 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

fixed alerts:

  • 1 for Non-exception in 'except' clause
  • 1 for Unused import

Copy link
Copy Markdown
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

thanks for taking this stub, can you check the lint failures please?

@atombrella
Copy link
Copy Markdown
Contributor Author

thanks for taking this stub, can you check the lint failures please?

Yes. I'm working on it. Have some patience ;)

@Kludex
Copy link
Copy Markdown
Contributor

Kludex commented Mar 6, 2022

Is the idea here to incrementally increase typing on Celery?

If yes, wouldn't it be interesting to support file by file? We did this on uvicorn: https://github.com/encode/uvicorn/blob/8585051189f0530165e901e0c5fab57998648943/setup.cfg#L5-L43

@Kludex
Copy link
Copy Markdown
Contributor

Kludex commented Mar 28, 2022

Do @atombrella you mind if I tackle the needed fixes here?

@atombrella
Copy link
Copy Markdown
Contributor Author

Do @atombrella you mind if I tackle the needed fixes here?

Please do :) I'm currently a bit caught up on other things.

@Kludex Kludex mentioned this pull request Mar 29, 2022
@Kludex
Copy link
Copy Markdown
Contributor

Kludex commented Mar 29, 2022

I've created #7383

@atombrella atombrella closed this Apr 2, 2022
@atombrella atombrella deleted the typing_annotations branch April 2, 2022 07:03
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