Closed ayharano closed 10 months ago
This is impacting us as well. Thanks @ayharano for reporting it.
I can confirm this does manifest itself with FastAPI v0.100.0. Using the "add_to" method the following error is thrown:
rollbar.contrib.fastapi.utils.FastAPIVersionError: FastAPI 0.41.0+ is required to use add_to() function
Downgrading to FastAPI 0.99.1 resolves the error.
Thanks @danielmorell for looking into this! This continues to block our upgrade path for fast-api 0.100+ versions.
In rollbar.cotnrib.fastapi.utils
, the following check appears:
if fastapi.__version__ < self.min_version:
A robust quick fix is to use Version
from PyPA's packaging, which is already a dependency of pytest
.
from packaging.version import Version
...
if Version(fastapi.__version__) < Version(self.min_version):
Or, since we know FastAPI uses PyPA-compatible versioning, we can be hacky:
if fastapi.__version__.split(".", 2) < self.min_version.split(".", 2):
Any news on this? It is blocking all our projects from updating properly.
This was released in the v1.0.0 beta.
Any word when 1.0.0 will be released (non-beta)?
Hey @josephgruber, 1.0.0 is planned to be released in 1-2 weeks at latest.
Version 1.0.0 is out now!
I was testing FastAPI
0.100.0-beta2
with Pydantic 2.0 released today and after a few adjustments, when I ran my test suite, it triggered an error due to https://github.com/rollbar/pyrollbar/blob/e3e159533dfec07ea0d7c2ec678267552db96bfb/rollbar/contrib/fastapi/utils.py#L31I triggered
ipdb
just before that line and it failed because the displayed line does a string-based comparison, not a proper SemVer comparisonThis issue will be perceived as soon as FastAPI
0.100.0
version is released and projects with pyrollbar use an unpinned version of FastAPI.