Skip to content

Pip upgrade for direct url requirements #417

Open
@bibsian

Description

@bibsian

The default pip version that the alpine docker ships with doesn't support direct URLs for dependency installation.

For example if we're trying to deploy a service with a private repo that has an install file like below, the deployment will error out with:
Direct url requirements in dependencies not supported

# Example private repo setup
setup(
    name="foo",
    packages=find_packages(exclude=["tests"])
    install_requires=(
        read_requirements("requirements.txt")+ # List of dependencies
        ["bar @ git+ssh://[email protected]/bar-project/bar#egg=bar"]
    )
)

I tried to get around this by editing lib/pip.js directly with the following changes:

function installRequirements(targetFolder, serverless, options) {
  ... # other code
  const pipCmd = [
    options.pythonBin,
    '-m',
    'pip',
    'install',
    ...options.pipCmdExtraArgs
  ];
  const pipUpgradeCmd = [
    options.pythonBin,
    '-m',
    'pip',
    'install',
    '--upgrade',
    'pip'
  ];
  const pipCmds = [pipUpgradeCmd,pipCmd];
  ... # other code
}

I can't say if this worked because I'm still debugging my deployment but any info on why this wouldn't work would help me.

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