Currently, Falcon ≥ 3.0.0-ALPHA is not supported by Sentry.
Falcon 3.0 renames the API class to APP. This trips the Sentry Falcon integration detection: the import of api_helpers is renamed to app_helpers.
Should be a simple fix, roughly:
try:
import falcon # type: ignore
from falcon import __version__ as FALCON_VERSION
try: # from L102
version = tuple(map(int, FALCON_VERSION.split(".")))
except (ValueError, TypeError):
raise DidNotEnable("Unparseable Falcon version: {}".format(FALCON_VERSION))
if version < (3, 0)
import falcon.api_helpers # type: ignore
falcon_helpers = falcon.api_helpers
else:
import falcon.app_helpers # type: ignore
falcon_helpers = falcon.app_helpers
except ImportError:
raise DidNotEnable("Falcon not installed")
and renaming all references to falcon.api_helpers to falcon_helpers.
A quick glance shows that PrepareMiddleware has not changed (returns the same tuple). I can go ahead and open a PR and check if other changes are necessary to support Falcon 3.0 before it comes out of alpha.
Feel free to, but I feel like it's wasted time until it comes out of alpha. Preparing support for APIs that change in the next alpha has bitten me in the past.
Fair point, I just looked at the status of the project and it might be a while. Can be picked up in the future.
Falcon 3.0 still hasn't been released so until that happens let's just close this.
@untitaker Falcon 3.0 was released 6 days ago.
Most helpful comment
@untitaker Falcon 3.0 was released 6 days ago.