adriangb / xpresso

A composable Python ASGI web framework
https://xpresso-api.dev/
MIT License
176 stars 4 forks source link

Cannot import name 'DependantBase' from 'di.api.dependencies' #111

Closed dantownsend closed 1 year ago

dantownsend commented 1 year ago

I'm getting this error when running Xpresso:

from di.api.dependencies import DependantBase
ImportError: cannot import name 'DependantBase' from 'di.api.dependencies'

I see you renamed something in di recently. How about putting something like this for backwards compatibility:

DependantBase = DependentBase
adriangb commented 1 year ago

I think I’ll just bump the minimum di version here. I guess I should really just pin it…

dantownsend commented 1 year ago

Yeah, I just came across this issue because in the Piccolo integration tests we're using xpresso==0.43.0 because FastAPI annoyingly version pins to older Starlette versions, so we can't resolve our dependencies with the latest xpresso.

I can try version pinning to an older di version for now.

dantownsend commented 1 year ago

I have a solution - version pinned di. Will close, thanks.

adriangb commented 1 year ago

Thanks. I still need to do something here so that this doesn't happen again, it's not the first time...

adriangb commented 1 year ago

FYI I released a new version with a fix and pined di version. Again terribly sorry for breaking your builds.

dantownsend commented 1 year ago

Cool, no worries.