encode / starlette

The little ASGI framework that shines. 🌟
https://www.starlette.io/
BSD 3-Clause "New" or "Revised" License
10.12k stars 910 forks source link

Drop `python-multipart` dependency #2390

Open Kludex opened 9 months ago

Kludex commented 9 months ago

We should have the multipart parsing on Starlette itself.

[!IMPORTANT]

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.

Fund with Polar

nanda-mik commented 3 months ago

@Kludex, I'd like to take on this task, please assign me. I've understood the parser classes and written test cases for them. I've also started implementing the parser functionality to phase out the dependency on python-multipart. I will try to complete this in some days and will submit a PR then.

Could you provide any specific things or best practices I should follow during the implementation? Additionally, would it be preferable to push the entire change at once or make smaller, incremental PRs?

Thanks!

rafalkrupinski commented 1 month ago

what's wrong with python-multipart?

Kludex commented 1 month ago

Nothing.

adriangb commented 1 month ago

I think the point is that even if nothing is wrong with it Starlette should still absorb that functionality since it's quite core to what Starlette does.

rafalkrupinski commented 1 month ago

I'd rather extract functions like this from existing projects, for greater modularization and to facilitate re-use, but you be you.

defnull commented 1 week ago

You could also consider switching from python-multipart to the (significantly smaller and faster) multipart project, or even vendor it if you prefer. The MIT license would allow shipping multipart.py as part of starlette.

Disclaimer: I'm the author of multipart and recently learned that the python-multipart project causes name conflicts for people because they decided to choose a package name that was already taken. I took that as an opportunity to clean up the project, release a new non-blocking parser that I was working on for a while now, increase test coverage to 100% and today I finally published the 1.0 release. I would obviously love to see starlette depend on multipart instead of python-multipart, but I'm probably biased ;)