fief-dev / fief-python

Fief client for Python
https://docs.fief.dev/integrate/python/
MIT License
11 stars 4 forks source link

fastapi: no module named makefun #11

Closed JustinGuese closed 1 year ago

JustinGuese commented 1 year ago

Describe the bug

makefun not found when using with fastapi

To Reproduce

fastapi example, py 3.11, linux

enai-backend-1  |   File "/app/app.py", line 13, in <module>
backend-1  |     from fief_client.integrations.fastapi import FiefAuth
backend-1  |   File "/usr/local/lib/python3.11/site-packages/fief_client/integrations/fastapi.py", line 25, in <module>
backend-1  |     from makefun import with_signature
backend-1  | ModuleNotFoundError: No module named 'makefun'

Expected behavior

A clear and concise description of what you expected to happen.

Configuration

Additional context

Add any other context about the problem here.

frankie567 commented 1 year ago

Hi @JustinGuese 👋

Did you install the optional fastapi dependency:

pip install "fief-client[fastapi]"
JustinGuese commented 1 year ago

ah alright, didn't know ;)! wouldn't it make sense to include it by default? as fief is used 99% of times with fastapi? but sure you might have a better overview

thanks for your work though!

frankie567 commented 1 year ago

Well, I don't want to stick only with FastAPI and I hope that other integrations will be included and used as well in the future 😄

For the record, it's mentioned in the FastAPI tutorial: https://docs.fief.dev/integrate/python/fastapi/