Skip to content

For the package process, allow arbitrary list of additional pip CLI options to run for the pip install #668

Closed as not planned
@cazlo

Description

@cazlo

Is your request related to a problem? Please describe.

When trying to package a lambda with pypi python dependencies in a few environments, I experience runtime issues with the cryptography dependency, as described at https://stackoverflow.com/questions/67646196/aws-lambda-python-cryptography-cannot-open-shared-object-files.

build env lambda runtime error (in aws)
alpine errors loading libc.muslc shared objects bindings
arm mac errors when loading cryptography rust bindings

I can get around this by doing the solution described at https://stackoverflow.com/a/74495308, effectively hardcoding in my local terraform package.py cache pip options: --only-binary=:all: --platform manylinux2014_x86_64.

Describe the solution you'd like.

Add a new variable similar to docker_additional_options like:

variable "pip_additional_options" {
  description = "Additional options to pass to the pip install command (e.g. to platform, etc.)"
  type        = list(string)
  default     = []
}

This would be passed to package.py and used to populate the pip install command list there (adding to current command defaults and not supporting override of them).

Describe alternatives you've considered.

ECR container image path

Additional context

Related to #459

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions