https://supertokens.com/ logo
#support-questions
Title
# support-questions
p

pepegc

03/26/2022, 11:04 AM
Dependencies issues on the backend. Is there a reason for
supertokens-python
not allowing the latest
fast-api
version? (0.75). Installing your package is generating issues downstream. Yesterday I managed to manually install all the packages but now the resulting requirements.txt is 'broken' for my cofounder. Maybe some dependency restrictions could be relaxed?
r

rp

03/26/2022, 11:15 AM
Hmm. There isn't any such restriction that I am aware of. What's the error message?
j

jabalazs

03/26/2022, 11:21 AM
Hi I'm pepegc's cofounder thank you for all your help. When trying to install alongside fastapi I get
Copy code
SolverProblemError

  Because no versions of fastapi match >0.75.0,<0.76.0
   and fastapi (0.75.0) depends on starlette (0.17.1), fastapi (>=0.75.0,<0.76.0) requires starlette (0.17.1).
  And because supertokens-python (0.5.2) depends on starlette (>=0.14.2,<0.15.0), fastapi (>=0.75.0,<0.76.0) is incompatible with supertokens-python (0.5.2).
  So, because api depends on both supertokens-python (0.5.2) and fastapi (^0.75.0), version solving failed.
is it maybe because we require the fastapi driver?
r

rp

03/26/2022, 11:44 AM
I see. I think we need to relax the dependency constraint a bit and then it should work. Let me test it with a newer version and push the change
j

jabalazs

03/26/2022, 11:51 AM
awesome, thanks!
r

rp

03/26/2022, 12:10 PM
hey @User can you try to use our lib via:
Copy code
pip install git+https://github.com/supertokens/supertokens-python.git@0.6
And see if that still gives the dependency error
Also, to remove our dependency on
starlette
we had to change slightly the API to import the middleware for fastapi: Previous:
Copy code
from supertokens_python.framework.fastapi import Middleware

app = FastAPI()
app.add_middleware(Middleware)
New:
Copy code
from supertokens_python.framework.fastapi import get_middleware

app = FastAPI()
app.add_middleware(get_middleware())
Can you please confirm that the above works as expected? In the meantime, we are running our CICD tests (takes a few hours) for the new version
j

jabalazs

03/26/2022, 12:22 PM
I can confirm that installing from
git+https://github.com/supertokens/supertokens-python.git@0.6
works. I will now see if the new middleware import works as expected
r

rp

03/26/2022, 12:22 PM
sounds good! thanks
j

jabalazs

03/26/2022, 12:26 PM
Copy code
from supertokens_python.framework.fastapi import get_middleware

app.add_middleware(get_middleware())
also seems to work ๐Ÿ™‚
thanks!
r

rp

03/26/2022, 12:26 PM
great! Will notify once the new version is releaed.
it will be v0.6.0
j

jabalazs

03/26/2022, 12:26 PM
awesome, thank you!
r

rp

03/26/2022, 12:26 PM
thanks for pointing out this issue
j

jabalazs

03/26/2022, 12:38 PM
sure! thank you for the awesome support!
p

pepegc

03/27/2022, 8:20 PM
Hi @User, got an estimate on when you'll release v0.6.0? ๐Ÿ˜‡
r

rp

03/27/2022, 8:20 PM
tomorrow.
hey @User @User released the new version
p

pepegc

03/28/2022, 9:41 AM
sweet, thanks!
we are still getting conflicts when trying to build in heroku, could you relax the following constraint?
dependency on PyJWT==2.0.*
r

rp

03/28/2022, 11:34 AM
hmm. Will check. thanks
p

pepegc

03/28/2022, 11:45 AM
actually scratch that, sorry. I hadn't updated to 0.6.0. Although that upgrade is giving me issues with fastapi-mail dependencies now.
r

rp

03/28/2022, 11:46 AM
Yea... dependencies in python are a PAIN
Will relax them further.
Can you please open an issue about this?
p

pepegc

03/28/2022, 11:49 AM
yes
r

rp

03/28/2022, 5:54 PM
What do you mean by if itโ€™s good?
p

pepegc

03/28/2022, 5:55 PM
if I import SuperTokens from supertokens-website I get an error saying it is undefined
I tried importing doesSessionExist directly and I get
fetch_1.default.recipeImpl is undefined
do yo happen to have an example of the plain JS implementation?
r

rp

03/28/2022, 6:03 PM
We donโ€™t have such an example, but this is strange. Lots and lots of people use this function.. so it works fine for sure. How are you importing and using the function? Are you doing it on server side or client side?
p

pepegc

03/28/2022, 6:04 PM
tried server side first, now client side. onMount
r

rp

03/28/2022, 6:06 PM
Iโ€™m not sure how the rendering works for this framework
Maybe the import is only done on the backend and the onMount is done on the frontend? Iโ€™m not sure
Also, please create a new thread for this. ๐Ÿ™‚
5 Views