I'm working on a project using the Serverless framework (serverless.com) and the way Lambda's are uploaded is to bundle all the files in the directory. The way you typically do this with serverless is to do something like
pip install -r requirements.txt -t ./vendored
Then in your python handler you'd have
import sys; sys.path.append('./vendored')
With pipenv I get the .venv directory but I'm not sure I want to bundle the whole virtualenv and upload that to AWS (or Google/azure) It would be nice if there was a command to generate a requirements.txt like output or install to a specific directory instead of a virtualenv for this sort of use case.
$ pipenv install --requirements
.
The requirements outputted are mixed with pipenv messages.
No package provided, installing all dependencies.
Pipfile found at /Users/foobarquaxx/Code/pipenv/Pipfile. Considering this to be the project home.
crayons==0.1.2 --hash=sha256:5e17691605e564d63482067eb6327d01a584bbaf870beffd4456a3391bd8809d
requirements-parser==0.1.0 --hash=sha256:fee2380a469ffe4067bc7f0096a6fcfb27539da7496fae12b74b8d5d0f33a4ee
pexpect==4.2.1 --hash=sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018
backports.shutil-get-terminal-size==1.0.0 --hash=sha256:0975ba55054c15e346944b38956a4c9cbee9009391e41b86c68990effb8c1f64
delegator.py==0.0.8 --hash=sha256:fbfbda2e36edb64250629a98911f8b0c8f5f66af5936608d1fb44d9b866c51d6
six==1.10.0 --hash=sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1
ptyprocess==0.5.1 --hash=sha256:464cb76f7a7122743dd25507650db89cd447c51f38e4671602b3eaa2e38e05ae
click==6.7 --hash=sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d
parse==1.6.6 --hash=sha256:a4862be306f334c36ae7adc73af028c56ca0139b8e39435e935bde8d481dd99e
MarkupSafe==0.23 --hash=sha256:a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3
jinja2==2.9.5 --hash=sha256:a7b7438120dbe76a8e735ef7eba6048eaf4e0b7dbc530e100812f8ec462a4d50
toml==0.9.2 --hash=sha256:b3953bffe848ad9a6d554114d82f2dcb3e23945e90b4d9addc9956f37f336594
colorama==0.3.7 --hash=sha256:a4c0f5bc358a62849653471e309dcc991223cf86abafbec17cd8f41327279e89
pipfile==0.0.1 --hash=sha256:a0bf9924d9bd25fa5e216d643fde49ff67f48727cb711a02ad806bf7c4722ea2
click-completion==0.2.1 --hash=sha256:079fb138887d4de12a0b7fbebf8d92d396b7c1a9c49f63475d9f3909d2588976
requests==2.13.0 --hash=sha256:1a720e8862a41aa22e339373b526f508ef0c8988baf48b84d3fc891a8e237efb
"no package provided" is stderr, not std out. if you pipe this output, it will be clean.
If you starting fresh, will get some stdout that's not related to the requirements though.
Code/pipenv git:(master) 禄 pipenv install --requirements 2> /dev/null
Creating a virtualenv for this project...
Using real prefix '/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/foobarquaxx/Code/pipenv/.venv/bin/python3.6
Also creating executable in /Users/foobarquaxx/Code/pipenv/.venv/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: /Users/foobarquaxx/Code/pipenv/.venv
crayons==0.1.2 --hash=sha256:5e17691605e564d63482067eb6327d01a584bbaf870beffd4456a3391bd8809d
requirements-parser==0.1.0 --hash=sha256:fee2380a469ffe4067bc7f0096a6fcfb27539da7496fae12b74b8d5d0f33a4ee
pexpect==4.2.1 --hash=sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018
backports.shutil-get-terminal-size==1.0.0 --hash=sha256:0975ba55054c15e346944b38956a4c9cbee9009391e41b86c68990effb8c1f64
delegator.py==0.0.8 --hash=sha256:fbfbda2e36edb64250629a98911f8b0c8f5f66af5936608d1fb44d9b866c51d6
six==1.10.0 --hash=sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1
ptyprocess==0.5.1 --hash=sha256:464cb76f7a7122743dd25507650db89cd447c51f38e4671602b3eaa2e38e05ae
click==6.7 --hash=sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d
parse==1.6.6 --hash=sha256:a4862be306f334c36ae7adc73af028c56ca0139b8e39435e935bde8d481dd99e
MarkupSafe==0.23 --hash=sha256:a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3
jinja2==2.9.5 --hash=sha256:a7b7438120dbe76a8e735ef7eba6048eaf4e0b7dbc530e100812f8ec462a4d50
toml==0.9.2 --hash=sha256:b3953bffe848ad9a6d554114d82f2dcb3e23945e90b4d9addc9956f37f336594
colorama==0.3.7 --hash=sha256:a4c0f5bc358a62849653471e309dcc991223cf86abafbec17cd8f41327279e89
pipfile==0.0.1 --hash=sha256:a0bf9924d9bd25fa5e216d643fde49ff67f48727cb711a02ad806bf7c4722ea2
click-completion==0.2.1 --hash=sha256:079fb138887d4de12a0b7fbebf8d92d396b7c1a9c49f63475d9f3909d2588976
requests==2.13.0 --hash=sha256:1a720e8862a41aa22e339373b526f508ef0c8988baf48b84d3fc891a8e237efb
ah, let's clean that up
all better!
@kennethreitz I don't think that fixes everything. You should also take care of virtualenv output I guess.
i believe i did that in another commit
all tested and working here
```
$ rm -fr .venv
$ pipenv install --requirements 2> /dev/null
crayons==0.1.2 --hash=sha256:5e17691605e564d63482067eb6327d01a584bbaf870beffd4456a3391bd8809d
requirements-parser==0.1.0 --hash=sha256:fee2380a469ffe4067bc7f0096a6fcfb27539da7496fae12b74b8d5d0f33a4ee
pexpect==4.2.1 --hash=sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018
backports.shutil-get-terminal-size==1.0.0 --hash=sha256:0975ba55054c15e346944b38956a4c9cbee9009391e41b86c68990effb8c1f64
delegator.py==0.0.8 --hash=sha256:fbfbda2e36edb64250629a98911f8b0c8f5f66af5936608d1fb44d9b866c51d6
requests==2.13.0 --hash=sha256:1a720e8862a41aa22e339373b526f508ef0c8988baf48b84d3fc891a8e237efb
six==1.10.0 --hash=sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1
ptyprocess==0.5.1 --hash=sha256:464cb76f7a7122743dd25507650db89cd447c51f38e4671602b3eaa2e38e05ae
parse==1.6.6 --hash=sha256:a4862be306f334c36ae7adc73af028c56ca0139b8e39435e935bde8d481dd99e
MarkupSafe==0.23 --hash=sha256:a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3
jinja2==2.9.5 --hash=sha256:a7b7438120dbe76a8e735ef7eba6048eaf4e0b7dbc530e100812f8ec462a4d50
toml==0.9.2 --hash=sha256:b3953bffe848ad9a6d554114d82f2dcb3e23945e90b4d9addc9956f37f336594
pipfile==0.0.1 --hash=sha256:a0bf9924d9bd25fa5e216d643fde49ff67f48727cb711a02ad806bf7c4722ea2
click-completion==0.2.1 --hash=sha256:079fb138887d4de12a0b7fbebf8d92d396b7c1a9c49f63475d9f3909d2588976
colorama==0.3.7 --hash=sha256:a4c0f5bc358a62849653471e309dcc991223cf86abafbec17cd8f41327279e89
click==6.7 --hash=sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d
Code/pipenv git:(master) 禄 git pull
Already up-to-date.
Code/pipenv git:(master) 禄 export PIPENV_COLORBLIND=1 && rm -rf .venv && pipenv install --requirements 2> /dev/null
Creating a virtualenv for this project...
Using real prefix '/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/foobarquaxx/Code/pipenv/.venv/bin/python3.6
Also creating executable in /Users/foobarquaxx/Code/pipenv/.venv/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: /Users/foobarquaxx/Code/pipenv/.venv
crayons==0.1.2 --hash=sha256:5e17691605e564d63482067eb6327d01a584bbaf870beffd4456a3391bd8809d
requirements-parser==0.1.0 --hash=sha256:fee2380a469ffe4067bc7f0096a6fcfb27539da7496fae12b74b8d5d0f33a4ee
pexpect==4.2.1 --hash=sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018
backports.shutil-get-terminal-size==1.0.0 --hash=sha256:0975ba55054c15e346944b38956a4c9cbee9009391e41b86c68990effb8c1f64
delegator.py==0.0.8 --hash=sha256:fbfbda2e36edb64250629a98911f8b0c8f5f66af5936608d1fb44d9b866c51d6
six==1.10.0 --hash=sha256:0ff78c403d9bccf5a425a6d31a12aa6b47f1c21ca4dc2573a7e2f32a97335eb1
ptyprocess==0.5.1 --hash=sha256:464cb76f7a7122743dd25507650db89cd447c51f38e4671602b3eaa2e38e05ae
click==6.7 --hash=sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d
parse==1.6.6 --hash=sha256:a4862be306f334c36ae7adc73af028c56ca0139b8e39435e935bde8d481dd99e
MarkupSafe==0.23 --hash=sha256:a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3
jinja2==2.9.5 --hash=sha256:a7b7438120dbe76a8e735ef7eba6048eaf4e0b7dbc530e100812f8ec462a4d50
toml==0.9.2 --hash=sha256:b3953bffe848ad9a6d554114d82f2dcb3e23945e90b4d9addc9956f37f336594
colorama==0.3.7 --hash=sha256:a4c0f5bc358a62849653471e309dcc991223cf86abafbec17cd8f41327279e89
pipfile==0.0.1 --hash=sha256:a0bf9924d9bd25fa5e216d643fde49ff67f48727cb711a02ad806bf7c4722ea2
click-completion==0.2.1 --hash=sha256:079fb138887d4de12a0b7fbebf8d92d396b7c1a9c49f63475d9f3909d2588976
requests==2.13.0 --hash=sha256:1a720e8862a41aa22e339373b526f508ef0c8988baf48b84d3fc891a8e237efb
@kennethreitz Sorry my bad. I was using an old version.
good :)
Most helpful comment
$ pipenv install --requirements
.