GithubHelp home page GithubHelp logo

dropseed / heroku-buildpack-poetry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moneymeets/python-poetry-buildpack

0.0 2.0 0.0 89 KB

Heroku buildpack that makes it possible to use Poetry with the official Python buildpack

License: MIT License

Shell 100.00%

heroku-buildpack-poetry's Introduction

Python Poetry Buildpack

A Heroku Buildpack for Poetry users.

How to use

The Python Poetry Buildpack prepares the build to be processed by a Python buildpack such as heroku/python by generating requirements.txt and runtime.txt from poetry.lock. With that said, your repo cannot have a requirements.txt, it will be exported from Poetry (for runtime.txt see below).

To set up the use of several buildpacks from the Heroku CLI use buildpacks:add:

heroku buildpacks:clear
heroku buildpacks:add https://github.com/forgepackages/heroku-buildpack-poetry.git
heroku buildpacks:add heroku/python

Configuration

Python

Python version can be forced by setting the PYTHON_RUNTIME_VERSION variable. Otherwise, it will be read from poetry.lock; for using Heroku default see below.

heroku config:set PYTHON_RUNTIME_VERSION=3.9.1

Poetry

Poetry version can be specified by setting POETRY_VERSION in Heroku config vars. Otherwise, it will default to a hardcoded version.

heroku config:set POETRY_VERSION=1.1.13

Generally all variables starting with POETRY_ are passed on to Poetry by this buildpack; see the corresponding Poetry documentation section for possible uses.

Exporting of development dependencies (e.g. to run tests in CI pipelines) can be optionally enabled by setting POETRY_EXPORT_DEV_REQUIREMENTS to 1:

heroku config:set POETRY_EXPORT_DEV_REQUIREMENTS=1

If you want to override the default export parameters (--without-hashes --with-credentials), you can set the POETRY_EXPORT_PARAMS config var. For example, you can use --with-hashes for added security, if you don't need git dependencies. This option is compatible with POETRY_EXPORT_DEV_REQUIREMENTS config var documented above.

heroku config:set POETRY_EXPORT_PARAMS=--with-hashes

runtime.txt

Generation of the runtime.txt can be skipped by setting DISABLE_POETRY_CREATE_RUNTIME_FILE to 1:

heroku config:set DISABLE_POETRY_CREATE_RUNTIME_FILE=1

If DISABLE_POETRY_CREATE_RUNTIME_FILE is set, the required Python version can be specified in runtime.txt. Otherwise, if runtime.txt is present in the repository, the buildpack will prevent the app from being deployed in order to avoid possible ambiguities.

Contributing

To test your changes locally run the (TAP-compatible) test suite:

bash run_tests.sh

heroku-buildpack-poetry's People

Contributors

zyv avatar marns93 avatar davegaeddert avatar deps-dropseed[bot] avatar forge-deps[bot] avatar felix11h avatar furious-luke avatar pogross avatar mergealot avatar ulgens avatar caioebassis avatar jkutner avatar mathieucaroff avatar mohebmithani avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.