pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.07k stars 232 forks source link

Can't install with poetry using latest python alpine Docker image #761

Closed erincerys closed 2 years ago

erincerys commented 2 years ago

Hi,

I'm running a container with the latest version of alpine and python: python:alpine. You can see this for yourself in said base image's Dockerfile.

I manage python module dependencies with poetry, which is also the latest version: 1.11.13.

I'm not installing make, as I expect a pre-compiled wheel to be available for musl and my architecture. I run this container on both x86 and aarch64, and do see the appropriate wheels on the PyPi downloads page.

Yet, I get an error indicating PyNaCl is attempting to be built. This is on x86_64:

#0 57.97   Command ['/usr/local/bin/python', '-m', 'pip', 'install', '--no-deps', '/root/.cache/pypoetry/artifacts/44/39/5f/2d2c436102b9571756ceb2e7665194c5
3ca1d70635fab6b6e377282da6/PyNaCl-1.5.0.tar.gz'] errored with the following return code 1, and output:                                                     
#0 57.97   Processing /root/.cache/pypoetry/artifacts/44/39/5f/2d2c436102b9571756ceb2e7665194c53ca1d70635fab6b6e377282da6/PyNaCl-1.5.0.tar.gz
#0 57.97     Installing build dependencies: started
#0 57.97     Installing build dependencies: finished with status 'done'
#0 57.97     Getting requirements to build wheel: started
#0 57.97     Getting requirements to build wheel: finished with status 'done'
#0 57.97     Preparing metadata (pyproject.toml): started
#0 57.97     Preparing metadata (pyproject.toml): finished with status 'done'
#0 57.97   Building wheels for collected packages: PyNaCl
#0 57.97     Building wheel for PyNaCl (pyproject.toml): started
#0 57.97     Building wheel for PyNaCl (pyproject.toml): finished with status 'error'
#0 57.97     error: subprocess-exited-with-error
#0 57.97
#0 57.97     × Building wheel for PyNaCl (pyproject.toml) did not run successfully.
...
Exception: ERROR: The 'make' utility is missing from PATH

I ended up using the workaround described in #696, and that's resolved it for now. Any idea what the problem here is?

(I've been reading other similar issues and saw y'all recommend installing the package from system repos, but I'm wary of doing this, as I'm not sure what poetry's behavior is. Will it try to install anyway? What if repos and pip are desync'd with pip having a newer version?)

alex commented 2 years ago

We do publish musllinux wheels for this package. I don't know anything about poetry. If this were pip I'd ask: What version of pip are you using? Have you tried upgrading to the latest version of pip?

alex commented 2 years ago

https://github.com/python-poetry/poetry/issues/5225 suggests that maybe this is a poetry bug.

alex commented 2 years ago

Yeah, this seems to be a poetry bug so I'm closing in favor of that.