laurentS/slowapi

Add support for python 3.11

laurentS opened this issue ยท 6 comments

Now that it's officially released, we should add support for it, as it's full of good stuff ๐Ÿฅ ๐Ÿ“ ๐Ÿ

I saw 3.11 was failing in CI. I testing bumping the fastapi and starlette dev dependencies to fastapi = "^0.86.0" and starlette = "^0.20.4", and the tests pass on 3.11 after that.

I also tested with fastapi = "^0.88.0" and starlette = "^0.22.0". This works, but requires httpx to also be installed as a dev dependency.

I wasn't sure if there is a specific reason the fastapi and starlette dependencies are being held back to the older versions. If not I'm happy to open a PR bumping them and adding 3.11 back to CI.

Nice find, thanks for looking into it @sanders41 !
I think the only reason we're keeping very loose version requirements on those is so that users with outdated installs can still get successful dependency resolutions. I think we could do different version requirements depending on the version of python, poetry allows that.
Does that seem ok to you?

FastAPI and Starlette are dev only dependencies so the versions listed are only used for testing, really only the version in the poetry.lock gets used. This is currently 0.61.2 for fastapi and 0.13.6 for starlette. If those dev dependencies are updated end users can still install any version they want. To verify this is true I looked at the current fastapi requirement (^0.61.0), then ran pip install slowapi fastapi==0.60.0 (notice the fastapi version is less than what is allowed in the pyproject.toml and everything installed without issue.

None of this is to say I won't update the dependencies with python specific versions. If that is still your preference I will certainly do that, I just wanted to make sure first.

Hi @sanders41 sorry for the delay in getting back to you. ๐ŸŽ… and stuff :)
Thanks for checking all this. Clearly I need to brush up my dependency versioning knowledge! I'd vote for updating dependencies if it doesn't break anything, and avoiding different version requirements if possible to avoid extra complexities.
Are you keen on opening a PR with these changes?

No worries on the delay, hope ๐ŸŽ… was good this year :)

PR here to update the dev dependencies for 3.11 #125

@laurentS Bump on the PR!