Skip to content

Unable to build Python lambda with package dependency in a private Git repository #253

@berciq

Description

@berciq

Description:

I am trying to use sam build to build a Python 3.7 lambda. My requirements.txt file contains the following dependency:

git+ssh://git@github.com/Berciq/commons.git@v0.0.4

So, as you can see, I am trying to include a package hosted in a private Git in my requirements.txt file as per the documentation. The package installs fine when using pip install -r requirements.txt but sam build throws the following error:

Build Failed
Error: PythonPipBuilder:ResolveDependencies - list index out of range

If I remove that dependency from my requirments.txt, sam build runs successfully.

Steps to reproduce the issue:

  1. Use sam init to create any Python-based AWS SAM application (e.g. hello-world)
  2. Add a private Git repo dependency to the requirements.txt file
  3. Run sam build

Observed result:
The build will fail with a PythonPipBuilder:ResolveDependencies error.

Expected result:
The build should succeed, given that running pip install -r requirements.txt succeeds.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
I'm running Ubuntu 20, AWS SAM CLI v.1.26.

But I was also able to reproduce the problem by installing and importing aws-lambda-builders as a module and running the PythonPipWorkflow, hence I'm raising the issue here.

This appears to be related in some way to Issue #229 but at the same time it's not exactly the same issue, as mine has to do specifically with dependencies hosted in a private repository.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions