Pipenv: Heroku support?

Created on 25 Jan 2017  路  10Comments  路  Source: pypa/pipenv

Is there any way way to use pipenv with Heroku?

I'm hoping to find one of:

  • Native Heroku support (detects Pipfile.lock)
  • Custom buildpack
  • Pre-compile hook to generate requirements.txt

Most helpful comment

All 10 comments

i wrote a custom buildpack, but it's very basic

waiting until the project settles down a bit first to make support official

Perfect! I'll report issues there if I run into anything.

leaving this open to remind me to clean it up :)

added some nicer indenting at least :)

Example bin/pre_compile (should work):

```
pip install pipenv
pipenv install
pipenv run pip > requirements.txt

@kennethreitz You mean pip freeze?

You don't have issues enabled on https://github.com/kennethreitz/heroku-buildpack-pipenv, so I'll comment here. I am now seeing this on Heroku CI:


KeyError: 'Pipfile-sha256'

-----> Reading app-ci.json...
-----> Fetching https://github.com/kennethreitz/heroku-buildpack-pipenv buildpack...
       buildpack downloaded
-----> Python app detected
     $ pip install -r requirements.txt
     $ pipenv install --system
       Creating a virtualenv for this project...
No package provided, installing all dependencies.
       Using base prefix '/app/.heroku/python'
       New python executable in /app/.venv/bin/python
       Installing setuptools, pip, wheel...done.

       Virtualenv location: /app/.venv
Pipfile found at /app/Pipfile. Considering this to be the project home.
Traceback (most recent call last):
  File "/app/.heroku/python/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==3.2.1', 'console_scripts', 'pipenv')()
  File "/app/.heroku/python/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/app/.heroku/python/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/app/.heroku/python/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/app/.heroku/python/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.6/site-packages/pipenv/cli.py", line 575, in install
    do_init(dev=dev, requirements=requirements, allow_global=system)
  File "/app/.heroku/python/lib/python3.6/site-packages/pipenv/cli.py", line 411, in do_init
    if not lockfile['_meta']['Pipfile-sha256'] == p.hash:
KeyError: 'Pipfile-sha256'


It seems like the buildpack needs a way update to the correct version of pipenv and/or pipenv needs to gracefully handle older lockfile formats.

make sure to use latest everything!

Was this page helpful?
0 / 5 - 0 ratings