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

Can't generate prisma client with docker alpine #461

Closed dualmacops closed 1 year ago

dualmacops commented 2 years ago

Bug description

When running prisma generate:

Downloading binaries [####################################] 100% Traceback (most recent call last): File "/usr/local/bin/prisma", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/site-packages/prisma/cli/cli.py", line 39, in main
sys.exit(prisma.run(args[1:])) File "/usr/local/lib/python3.10/site-packages/prisma/cli/prisma.py", line 76, in run process = subprocess.run( File "/usr/local/lib/python3.10/subprocess.py", line 501, in run with Popen(*popenargs, **kwargs) as process: File "/usr/local/lib/python3.10/subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.10/subprocess.py", line 1845, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/prisma/binaries/engines/efdf9b1183dddfd4258cd181a72125755215ab7b/prisma-cli-linux'

How to reproduce

Run a python container with base image python:3.10.5-alpine3.16 and run prisma generate

Hot to fix

Change to a debian based image example: FROM python:3.10.5-slim-buster

RobertCraigie commented 2 years ago

Hey @dualmacops, sorry for the delay in responding to you.

We currently do not have good support for handling differing linux distributions.

Could you please try installing from #454 and let me know if that works for you? You can install it using this command

pip install -U git+https://github.com/RobertCraigie/prisma-client-py@refactor/remove-pkg-cli
jacobdr commented 1 year ago

We can probably add this to the matrix proposed here and pass that through as a build arg to the OS_DISTRO here to exercise this as a test case (in a very basic way... it would not really do any runtime testing but its a step in the right directory)

caelx commented 1 year ago

Hey @dualmacops, sorry for the delay in responding to you.

We currently do not have good support for handling differing linux distributions.

Could you please try installing from #454 and let me know if that works for you? You can install it using this command

pip install -U git+https://github.com/RobertCraigie/prisma-client-py@refactor/remove-pkg-cli

I ran into the same problem and tried using this version, it definitely worked for me to allow the client to be generated.

RobertCraigie commented 1 year ago

Glad to hear it, thanks @sipfix!