Skip to content

Package individually not working with pipenv modules #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
username-dot-com opened this issue Oct 12, 2018 · 4 comments
Open

Package individually not working with pipenv modules #268

username-dot-com opened this issue Oct 12, 2018 · 4 comments

Comments

@username-dot-com
Copy link

I have a service where each function is a module using pipenv to manage dependencies for each module. The plugin doesn't generate requirements.txt using pipenv unless I have a Pipfile in the root of the service, even if I have them in the modules. However, when I do that, the plugin generates a requirements.txt for each module using the root pipfile instead of the pipfile in the module itself.

I think the issue might be in the function "pipfileToRequirements()" in pipenv.js. It always passes the service root to the spawnSync call.

Packaging seems to work if I manually generate the requirements.txt in each module prior to sls deploy/package. Though there is still another issue where serverless generates two zips per function. One zip is named the lambda function name specified in serverless.yml that follows include/exclude but otherwise would contain the entire service. The other is a zip named the lambda function after it is deployed which I believe is the one generated by this plugin. My understanding according to the docs is there should only be 2 zips?

I'm not sure if these two issues are related to each other nor if the second issue isn't really an issue and is just how it works currently, so I'd like some insight into this if possible.

I've created a reproduction repo for this here:
https://github.com/username-dot-com/sls-python-test

@dschep
Copy link
Contributor

dschep commented Oct 12, 2018

Good catch. That was probably over looked in the package individually implementation. cc @cgrimal

bweigel pushed a commit to bweigel/serverless-python-requirements that referenced this issue Nov 24, 2018
- migrates tests from bats to tape
bweigel pushed a commit to bweigel/serverless-python-requirements that referenced this issue Nov 24, 2018
- migrates tests from bats to tape
@felschr
Copy link

felschr commented Aug 14, 2019

It would be nice if this were documented somewhere.
Tried to setup the plugin with pipenv yesterday for quite a while until I found this issue.

@psvaiter
Copy link

psvaiter commented Feb 7, 2022

Is it already fixed? I took a long time searching for a solution until I find this issue. I was suspecting that Pipfile was not supported in modules.

@pgrzesik
Copy link
Contributor

pgrzesik commented Feb 8, 2022

It seems to not be fixed, but we would definitely be happy to accept a solution/improvement PR for this. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants