Skip to content

Dockerized build does not include local dependencies from a different directory #35

@sblask

Description

@sblask

I've got a pyproject.toml with the following dependencies:

[tool.poetry.dependencies]
python = "~3.12.0"

bedrock = {path = "../../lib/local-dependency", develop = true}
boto3 = "1.35.73"
structlog = "24.4.0"

and this config:

[tool.poetry-plugin-lambda-build]
docker-image = "public.ecr.aws/sam/build-python3.12:latest-x86_64"
docker-network = "host"
package-artifact-path = "lambda_function.zip"
without = "dev"

poetry build-lambda worked fine without the docker config, but I am running on Mac, so need to build in a container. After adding docker-image and docker-network I get:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/lib/local-dependency'

local-dependency is in the same repo as the lambda code, but in a parent directory of the lambda, so isn't copied into the container.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions