Updated examples with lifespan usage (instead of deprecated .init_app() method)
Better typing for decorators
Increase required Python version to >=3.8 (syncing with fastAPI)
Adjust dependencies to work with new fastapi-slim package variant, available since fastAPI v0.111.0
Here in fastapi-mqtt we only use from fastapi import FastAPI for testing and typing, so it is not a required dependency after all.
Moving it to the dev-dependencies group, with pytest and others, enables the usage of this library in projects using only the new fastapi-slim package, remaining compatible with the 'normal' fastapi
π¨ Update all examples to use modern fastapi lifespan
π¨ Remove import of FastAPI object inside library, as it's only used for typing inside a deprecated method
π¦οΈ env: Bump minor version and re-define deps and classifiers, moving fastapi to dev-dependencies, as it is used/required only for testing, and enables compatibility with fastapi-slim package, so projects using this library are not forced to install the full package. Same goes for uvicorn, which is an optional import to configure a logger
cc @sabuhish
closes #91
Maintenance update, with minor changes:
lifespan
usage (instead of deprecated.init_app()
method)fastapi-slim
package variant, available since fastAPI v0.111.0Here in
fastapi-mqtt
we only usefrom fastapi import FastAPI
for testing and typing, so it is not a required dependency after all.Moving it to the
dev-dependencies
group, with pytest and others, enables the usage of this library in projects using only the newfastapi-slim
package, remaining compatible with the 'normal'fastapi
All changes
pyproject.toml
, addingmypy
strict settingsFastAPI
object inside library, as it's only used for typing inside a deprecated methodfastapi
to dev-dependencies, as it is used/required only for testing, and enables compatibility withfastapi-slim
package, so projects using this library are not forced to install the full package. Same goes foruvicorn
, which is an optional import to configure a logger