virtuald/pyhcl

Module not tagged properly for off-architecture installs

dpedu opened this issue · 3 comments

dpedu commented

Pip supports various flags that cause it to download and install versions of modules that are different from the architecture from the host running Pip.

This is useful for building programs in situations where the build system architecture does not match where the program will run. A real world example of this is AWS Lambda. I could be building my program on a mac and need to install the linux x86 or linux arm64 version of a package so that it is able to run on AWS Lambda.

An example command to install this package as I am describing above would be:

pip3 install --platform manylinux2014_x86_64 --implementation cp --python-version 3.9 --only-binary=:all: --target ./outdir pyhcl

However, this command fails with:

ERROR: Could not find a version that satisfies the requirement pyhcl (from versions: none)
ERROR: No matching distribution found for pyhcl

This error is because no version of pyhcl matches the filters I specified, because it is tagged incorrectly.

You may be thinking, "but this project is pure python - why do you need to specify --platform and the other flags?

My project uses other modules, some of which do have architecture/os specific binary components. Meaning, I'm running the above pip command but pointing at a requirements.txt file, that includes other modules that eventually depend on pyhcl.

I think the project is missing the tag for compatible python implementations. Looking at hvac, which depends on this module and is also pure python but does not suffer this issue, that project is tagged as being compatible with cpython, whereas pyhcl isn't.

The issue is that you specified --only-binary=:all:, and pyhcl has only published source distributions. To fix it I can publish a wheel, maybe tonight.

dpedu commented

I appreciate it, and thanks for that information too.

0.4.5 has a wheel published now and your command line for installing works for me.