heroku-buildpack-python

The official Heroku buildpack for Python apps.

Github星跟踪图

python

Heroku Buildpack: Python

Build Status

This is the official Heroku buildpack for Python apps.

Recommended web frameworks include Django and Flask, among others. The recommended webserver is Gunicorn. There are no restrictions around what software can be used (as long as it's pip-installable). Web processes must bind to $PORT, and only the HTTP protocol is permitted for incoming connections.

Python packages with C dependencies that are not available on the stack image are generally not supported, unless manylinux wheels are provided by the package maintainers (common). For recommended solutions, check out this article for more information.

See it in Action

$ ls
my-application		requirements.txt	runtime.txt

$ git push heroku master
Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 276 bytes, 276.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.4
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting flask (from -r /tmp/build_c2c067ef79ff14c9bf1aed6796f9ed1f/requirements.txt (line 1))
remote:          Downloading ...
remote:        Installing collected packages: Werkzeug, click, MarkupSafe, Jinja2, itsdangerous, flask
remote:        Successfully installed Jinja2-2.10 MarkupSafe-1.1.0 Werkzeug-0.14.1 click-7.0 flask-1.0.2 itsdangerous-1.1.0
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> (none)
remote:

A requirements.txt must be present at the root of your application's repository to deploy.

To specify your python version, you also need a runtime.txt file - unless you are using the default Python runtime version.

Current default Python Runtime: Python 3.6.9

Alternatively, you can provide a setup.py file, or a Pipfile. Using Pipenv will generate runtime.txt based on python-version at build time.

Specify a Buildpack Version

You can specify the latest production release of this buildpack for upcoming builds of an existing application:

$ heroku buildpacks:set heroku/python

Specify a Python Runtime

Supported runtime options include:

  • python-3.7.4
  • python-3.6.9
  • python-2.7.17

Tests

The buildpack tests use Docker to simulate
Heroku's stack images.

To run the test suite:

make test

Or to test in a particular stack:

make test-heroku-18
make test-heroku-16

The tests are run via the vendored
shunit2
test framework.

概览

名称与所有者heroku/heroku-buildpack-python
主编程语言Ruby
编程语言Shell (语言数: 4)
平台
许可证MIT License
发布数232
最新版本名称v249 (发布于 )
第一版名称archive/v3 (发布于 )
创建于2011-05-17 20:26:30
推送于2024-04-22 13:33:09
最后一次提交
星数1k
关注者数121
派生数1.8k
提交数2.5k
已启用问题?
问题数543
打开的问题数13
拉请求数777
打开的拉请求数3
关闭的拉请求数240
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?
去到顶部