Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plan to annotate - Kombu #1511

Open
Kludex opened this issue Apr 8, 2022 · 10 comments
Open

Plan to annotate - Kombu #1511

Kludex opened this issue Apr 8, 2022 · 10 comments

Comments

@Kludex
Copy link
Contributor

Kludex commented Apr 8, 2022

Fully Type Annotation - Kombu

Analogous to celery/celery#7394.

Status Filename PR
__init__.py #1527
abstract.py #1522
asynchronous/__init__.py #1527
asynchronous/aws/__init__.py #1527
asynchronous/aws/connection.py
💬 asynchronous/aws/ext.py #1566
asynchronous/aws/sqs/__init__.py #1527
asynchronous/aws/sqs/connection.py
💬 asynchronous/aws/sqs/ext.py #1566
asynchronous/aws/sqs/message.py
asynchronous/aws/sqs/queue.py
asynchronous/debug.py
asynchronous/http/__init__.py #1527
asynchronous/http/base.py
asynchronous/http/curl.py
asynchronous/hub.py
💬 asynchronous/semaphore.py #1513
asynchronous/timer.py
clocks.py #1526
common.py
compat.py
compression.py
connection.py
entity.py
exceptions.py #1526
log.py
matcher.py #1532
message.py
messaging.py
mixins.py
pidbox.py
pools.py
resource.py
serialization.py
simple.py
transport/SLMQ.py
transport/SQS.py
transport/__init__.py #1527
transport/azureservicebus.py
transport/azurestoragequeues.py
transport/base.py
transport/consul.py
transport/etcd.py
transport/filesystem.py
transport/librabbitmq.py
transport/memory.py
transport/mongodb.py
transport/pyamqp.py
transport/pyro.py
transport/qpid.py
transport/redis.py
transport/sqlalchemy/__init__.py
transport/sqlalchemy/models.py
transport/virtual/__init__.py #1527
transport/virtual/base.py
transport/virtual/exchange.py
transport/zookeeper.py
utils/__init__.py #1527
utils/amq_manager.py
utils/collections.py
utils/compat.py
utils/debug.py
utils/div.py
utils/encoding.py
utils/eventio.py
utils/functional.py
utils/imports.py
💬 utils/json.py #1529
💬 utils/limits.py #1525
utils/objects.py
💬 utils/scheduling.py #1523
utils/text.py #1514
utils/time.py #1512
💬 utils/url.py #1519
utils/uuid.py #1514

✅ (:white_check_mark:): Merged
❌ (:x:): Need work
💬 (:speech_balloon:): In review

Report generated from mypy kombu --txt-report . (04/05/2022):

Mypy Type Check Coverage Summary
================================

Script: index

+---------------------------------------+-------------------+-----------+
| Module                                | Imprecision       | Lines     |
+---------------------------------------+-------------------+-----------+
| kombu                                 |  13.91% imprecise |   115 LOC |
| kombu.asynchronous.aws                |  17.65% imprecise |    17 LOC |
| kombu.asynchronous.aws.connection     |  53.68% imprecise |   272 LOC |
| kombu.asynchronous.aws.sqs.connection |  68.91% imprecise |   193 LOC |
| kombu.asynchronous.aws.sqs.message    |  28.57% imprecise |    35 LOC |
| kombu.asynchronous.aws.sqs.queue      |  59.23% imprecise |   130 LOC |
| kombu.asynchronous.debug              |  52.24% imprecise |    67 LOC |
| kombu.asynchronous.http               |   7.14% imprecise |    28 LOC |
| kombu.asynchronous.http.base          |  29.85% imprecise |   268 LOC |
| kombu.asynchronous.http.curl          |  67.13% imprecise |   289 LOC |
| kombu.asynchronous.hub                |  53.90% imprecise |   397 LOC |
| kombu.asynchronous.semaphore          |   6.40% imprecise |   125 LOC |
| kombu.asynchronous.timer              |  47.92% imprecise |   240 LOC |
| kombu.clocks                          |  13.64% imprecise |   154 LOC |
| kombu.common                          |  39.13% imprecise |   437 LOC |
| kombu.compat                          |  56.83% imprecise |   227 LOC |
| kombu.compression                     |  26.27% imprecise |   118 LOC |
| kombu.connection                      |  39.09% imprecise |  1077 LOC |
| kombu.entity                          |  36.64% imprecise |   868 LOC |
| kombu.log                             |  54.68% imprecise |   139 LOC |
| kombu.matcher                         |  24.44% imprecise |   135 LOC |
| kombu.message                         |  42.36% imprecise |   229 LOC |
| kombu.messaging                       |  37.42% imprecise |   652 LOC |
| kombu.mixins                          |  31.89% imprecise |   301 LOC |
| kombu.pidbox                          |  63.68% imprecise |   413 LOC |
| kombu.pools                           |  48.03% imprecise |   152 LOC |
| kombu.resource                        |  48.39% imprecise |   248 LOC |
| kombu.serialization                   |  37.83% imprecise |   460 LOC |
| kombu.simple                          |  49.08% imprecise |   163 LOC |
| kombu.transport.SLMQ                  |  49.50% imprecise |   202 LOC |
| kombu.transport.SQS                   |  47.05% imprecise |   899 LOC |
| kombu.transport.azureservicebus       |  32.21% imprecise |   447 LOC |
| kombu.transport.azurestoragequeues    |  30.33% imprecise |   211 LOC |
| kombu.transport.base                  |  31.60% imprecise |   269 LOC |
| kombu.transport.confluentkafka        |  43.54% imprecise |   379 LOC |
| kombu.transport.consul                |  38.92% imprecise |   316 LOC |
| kombu.transport.etcd                  |  36.43% imprecise |   291 LOC |
| kombu.transport.filesystem            |  34.20% imprecise |   348 LOC |
| kombu.transport.librabbitmq           |  50.00% imprecise |   190 LOC |
| kombu.transport.memory                |  37.74% imprecise |   106 LOC |
| kombu.transport.mongodb               |  47.06% imprecise |   510 LOC |
| kombu.transport.pyamqp                |  40.71% imprecise |   253 LOC |
| kombu.transport.pyro                  |  41.51% imprecise |   212 LOC |
| kombu.transport.qpid                  |  20.31% imprecise |  1748 LOC |
| kombu.transport.redis                 |  50.07% imprecise |  1428 LOC |
| kombu.transport.sqlalchemy            |  40.08% imprecise |   247 LOC |
| kombu.transport.sqlalchemy.models     |  47.37% imprecise |    76 LOC |
| kombu.transport.virtual.base          |  46.83% imprecise |  1025 LOC |
| kombu.transport.virtual.exchange      |  28.13% imprecise |   160 LOC |
| kombu.transport.zookeeper             |  48.43% imprecise |   223 LOC |
| kombu.utils.amq_manager               |  59.09% imprecise |    22 LOC |
| kombu.utils.collections               |  37.78% imprecise |    45 LOC |
| kombu.utils.compat                    |  40.58% imprecise |   138 LOC |
| kombu.utils.debug                     |  58.06% imprecise |    62 LOC |
| kombu.utils.div                       |  48.57% imprecise |    35 LOC |
| kombu.utils.encoding                  |  38.14% imprecise |    97 LOC |
| kombu.utils.eventio                   |  66.57% imprecise |   329 LOC |
| kombu.utils.functional                |  49.72% imprecise |   356 LOC |
| kombu.utils.imports                   |  29.85% imprecise |    67 LOC |
| kombu.utils.json                      |  42.00% imprecise |   100 LOC |
| kombu.utils.limits                    |  33.73% imprecise |    83 LOC |
| kombu.utils.objects                   |  45.76% imprecise |    59 LOC |
| kombu.utils.scheduling                |  35.45% imprecise |   110 LOC |
| kombu.utils.url                       |  16.15% imprecise |   130 LOC |
+---------------------------------------+-------------------+-----------+
| Total                                 |  40.29% imprecise | 19636 LOC |
+---------------------------------------+-------------------+-----------+
@open-collective-bot
Copy link

Hey @Kludex 👋,
Thank you for opening an issue. We will get back to you as soon as we can.
Also, check out our Open Collective and consider backing us - every little helps!

We also offer priority support for our sponsors.
If you require immediate assistance please consider sponsoring us.

@dobosevych
Copy link
Contributor

Is there any priority? I can help with some of this tasks

@Kludex
Copy link
Contributor Author

Kludex commented Apr 13, 2022

Is there any priority? I can help with some of this tasks

Not really. Go ahead. 🙏

@auvipy
Copy link
Member

auvipy commented Apr 14, 2022

Is there any priority? I can help with some of this tasks

just avoid duplicated work, so checking open or closed PR will help to avoid that

@dobosevych
Copy link
Contributor

Created a PR to no duplicate work

@Kludex
Copy link
Contributor Author

Kludex commented Jun 25, 2022

I didn't forget about this. I'm struggling with time. JFYK.

@auvipy
Copy link
Member

auvipy commented May 11, 2023

I was thinking of stubs instead of annotating the codes directly

@Kludex
Copy link
Contributor Author

Kludex commented May 11, 2023

Why?

@stegayet
Copy link
Contributor

stegayet commented May 12, 2023

Taking utils/debug.py with #1714 and utils/compat.py with #1715.

@Viicos
Copy link

Viicos commented Feb 16, 2024

I was thinking of stubs instead of annotating the codes directly

Hi @auvipy,

I wanted to continue working on type hints for kombu and celery (preferably kombu first as celery is built on top of it).

Are you still open to have type hints directly in both projects? I can understand the drawbacks of having them in the source code (can block people contributing, extra CI checks, extra review for PRs adding typing), although there are benefits of having them builtin in the source code instead of stubs (never gets out of sync, readability for users of the library).

If this is the case, I'd like to offer three things:

  • contributions to add type hints
  • reviews to existing/upcoming typing PRs
  • update contributing docs (if any) regarding typing practices: mainly usage of from __future__ import annotations, typing_extensions, etc.

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

No branches or pull requests

5 participants