Serverless-python-requirements: Plugin doesn't seem to support -r in requirements.txt

Created on 18 Aug 2017  路  5Comments  路  Source: UnitedIncome/serverless-python-requirements

I have a requirements.txt file like this:

-r requirements-pipenv.txt
-e ./api

because pipenv install doesn't work with -e. (You could also imagine different uses for -r in this file, such as those discussed here.)

When I sis deploy, though, I get this message:

Could not open requirements file: [Errno 2] No such file or directory: '.serverless/requirements-pipenv.txt'

This appears to be because this plugin only copies requirements.txt and not files that it includes. I looked at the README and didn't see a way to make it include other files, but I might have missed something.

It would be useful if the plugin either:

  1. Auto-discovered -r lines in requirements.txt and added those files as well; and/or
  2. Allowed me to explicitly configure what files to include
bug

All 5 comments

Hmm. This is a consequence of #33. That could be redesigned to just be a list of pkgs to exclude in the serverless.yml file instead of as comments in requirements.txt.

Concequences of that:

  • Fixes this bug
  • makes the the deploy omissions apply to any pkgs included with a -r line in requirements.txt like in this PR

    • doesn't omit dependencies of packages omitted

cc @medwig

The other option is to go back to @medwig's initial implementation of #33 which dropped the .requirements.txt file in the current dir rather than with out the . into .serverless.

And as a temporary workaround to allow you to deploy @brettdh, change it to -r ../requirements-pipenv.txt when deploying.

Thanks. I'm currently using the workaround of generating requirements.txt with a script, so that I don't have to change it when deploying vs serving locally.

FWIW, I haven't looked at the details of that PR, but at a glance it makes more sense to me to put ignore config specific to serverless-python-requirements into serverless.yml.

I've released this in version 3.0.0-beta. It's a major version because the no deploy change is a breaking change and it's a beta because @UnitedIncome is nearing a public launch so I don't wanna pull a bunch of changes into our release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amitm02 picture amitm02  路  6Comments

amitm02 picture amitm02  路  5Comments

simplesteph picture simplesteph  路  5Comments

bsamuel-ui picture bsamuel-ui  路  3Comments

amadensor picture amadensor  路  3Comments