airtai / faststream

FastStream is a powerful and easy-to-use Python framework for building asynchronous services interacting with event streams such as Apache Kafka, RabbitMQ, NATS and Redis.
https://faststream.airt.ai/latest/
Apache License 2.0
3.17k stars 162 forks source link

Fix types for Python 3.12 #1883

Closed davorrunje closed 2 weeks ago

davorrunje commented 3 weeks ago

Description

Please include a summary of the change and specify which issue is being addressed. Additionally, provide relevant motivation and context.

Fixes # (issue number)

Type of change

Please delete options that are not relevant.

Checklist

Lancetnik commented 3 weeks ago

Looks like unnecessary changes

Lancetnik commented 3 weeks ago

Btw, our mypu CI check has difference with local run and I didn't find the reason yet

kumaranvpl commented 2 weeks ago

@Lancetnik We use python 3.10 in actions to run mypy - https://github.com/airtai/faststream/blob/main/.github/workflows/pr_tests.yaml#L36-L38. I assume you are using the same python version for development also.

But in 3.12, there are some new mypy issues which Davor fixed and created this PR. In 3.10, those mypy issues doesn't show up so the CI was failing. We need to switch to python 3.12 in CI for static analysis.

Lancetnik commented 2 weeks ago

@Lancetnik We use python 3.10 in actions to run mypy - https://github.com/airtai/faststream/blob/main/.github/workflows/pr_tests.yaml#L36-L38. I assume you are using the same python version for development also.

But in 3.12, there are some new mypy issues which Davor fixed and created this PR. In 3.10, those mypy issues doesn't show up so the CI was failing. We need to switch to python 3.12 in CI for static analysis.

Interesting, I didn't know, that mypy checks depends on python - version instead of mypy package. I'll take a look at these types today and try to fix the problem without ignoring, thank you for the report