Running in a docker container using python:3.12 with Poetry (version 2.1.2), I get the following error:
root@ecea54dc0a7f:/code# poetry add fastapi-mqtt
Using version ^2.2.0 for fastapi-mqtt
Updating dependencies
Resolving dependencies... (0.0s)
The current project's supported Python range (>=3.12) is not compatible with some of the required packages Python requirement:
- fastapi-mqtt requires Python <4.0,>=3.8, so it will not be installable for Python >=4.0
Because no versions of fastapi-mqtt match >2.2.0,<3.0.0
and fastapi-mqtt (2.2.0) requires Python <4.0,>=3.8, fastapi-mqtt is forbidden.
So, because hub depends on fastapi-mqtt (^2.2.0), version solving failed.
* Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
For fastapi-mqtt, a possible solution would be to set the `python` property to ">=3.12,<4.0"
https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
https://python-poetry.org/docs/dependency-specification/#using-environment-markers
I was able to resolve this by changing my pyproject.toml to requires-python = "^3.12" from the default requires-python = ">=3.12" . However that's not normally required and I think the range of <4.0 should be removed.
Running in a docker container using
python:3.12with Poetry (version 2.1.2), I get the following error:I was able to resolve this by changing my
pyproject.tomltorequires-python = "^3.12"from the defaultrequires-python = ">=3.12". However that's not normally required and I think the range of <4.0 should be removed.