Cloud Foundry Python Buildpack
A Cloud Foundry buildpack for Python based apps.
This is based on the Cloud Foundry Python Buildpack.
This buildpack supports running Django and Flask apps.
This buildpack includes pdf2htmlEX which can be called as a shell command.
Buildpack User Documentation
Official buildpack documentation can be found at http://docs.cloudfoundry.org/buildpacks/python/index.html.
Building the Buildpack
- Make sure you have fetched submodules
git submodule update --init
- Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
- Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ --uncached | --cached ]
-
Use in Cloud Foundry
Upload the buildpack to your Cloud Foundry and optionally specify it by name
cf create-buildpack custom_python_buildpack python_buildpack-cached-custom.zip 1 cf push my_app -b custom_python_buildpack
Testing
Buildpacks use the Machete framework for running integration tests.
To test a buildpack, run the following command from the buildpack's directory:
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-build
More options can be found on Machete's Github page.
How to use pdf2htmlEX in the buildpack
pdf2htmlEX can be used as a shell command. The following example shows how to use it in a python app:
import os
os.system("pdf2htmlEX --data-dir ./vendor/pdf2htmlEX/data-dir/ aPdfFile.pdf anHtmlFile.html"
Keep in mind, every time we want to call pdf2htmlEX we need to pass the --data-dir
parameter and the following directory in order to tell pdf2htmlEX where to look for the manifest and other important files.
Contributing
Find our guidelines here.
Help and Support
Join the #buildpacks channel in our [Slack community] (http://slack.cloudfoundry.org/) if you need any further assistance.
Reporting Issues
Open a GitHub issue on this project here
Active Development
The project backlog is on Pivotal Tracker