RobertCraigie / prisma-client-py

Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
https://prisma-client-py.readthedocs.io
Apache License 2.0
1.83k stars 77 forks source link

Package binaries in wheels as an alternative to downloading at runtime #55

Open RobertCraigie opened 3 years ago

RobertCraigie commented 3 years ago

Problem

We currently only package one universal wheel when we could make use of platform dependent wheels to improve first-time user experience, when someone installs a python package they don't expect to have to wait while more binaries are downloaded.

Suggested solution

Update setup.py wheel building to build platform dependent wheels for every platform that prisma supports, we could also fall back to building the rust binaries on the user's machine if they are on an unsupported platform but thats outside the scope of this issue.

RobertCraigie commented 3 years ago

Something I didn't consider when creating this issue is the file size limit on PyPi, this appears to be 60MB.

Running a naive tar -zcvf binaries.tar.gz BINARIES_DIR creates a 79MB tarball on MacOS :/

I don't know what compression would be used when actually packaging the files.

RobertCraigie commented 3 years ago

Successfully uploaded the packaged binaries to testpypi

RobertCraigie commented 3 years ago

The only concern I have with this is increasing install times on slower connections, however this could probably be mitigated by packaging a platform agnostic wheel that doesn't include the binaries and then users can install with --platform=none if they need to.

I do not know if this is possible though.

RobertCraigie commented 3 years ago

Upon further thought I do not know if the slow download time would matter that much as the binaries would have to be downloaded anyway to use the library.

RobertCraigie commented 2 years ago

Could use https://github.com/ziglang/zig-pypi for inspiration.

RobertCraigie commented 2 years ago

Another concern with this is that the binaries would be redundant when using either the Prisma Data Proxy or the Native query engine although support for these has not been implemented yet