Dependencies issues on the backend. Is there a rea...
# support-questions
p
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
Hmm. There isn't any such restriction that I am aware of. What's the error message?
j
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
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
awesome, thanks!
r
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
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
sounds good! thanks
j
Copy code
from supertokens_python.framework.fastapi import get_middleware

app.add_middleware(get_middleware())
also seems to work ๐Ÿ™‚
thanks!
r
great! Will notify once the new version is releaed.
it will be v0.6.0
j
awesome, thank you!
r
thanks for pointing out this issue
j
sure! thank you for the awesome support!
p
Hi @User, got an estimate on when you'll release v0.6.0? ๐Ÿ˜‡
r
tomorrow.
hey @User @User released the new version
p
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
hmm. Will check. thanks
p
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
Yea... dependencies in python are a PAIN
Will relax them further.
Can you please open an issue about this?
p
yes
r
What do you mean by if itโ€™s good?
p
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
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
tried server side first, now client side. onMount
r
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