GithubHelp home page GithubHelp logo

Comments (7)

tuergeist avatar tuergeist commented on June 9, 2024 1

@jefer94 You might want to have a look at this https://github.com/tuergeist/heroku-pdm-skeleton - I put my pdm heroku example together as minimal project using fastapi.

from heroku-buildpack-python.

jefer94 avatar jefer94 commented on June 9, 2024

That look good

from heroku-buildpack-python.

edmorley avatar edmorley commented on June 9, 2024

You might want to have a look at this https://github.com/tuergeist/heroku-pdm-skeleton - I put my pdm heroku example together as minimal project using fastapi.

@tuergeist Hi! Taking a look at that repo I see it's running PDM install in the Procfile. This is very very much not a good idea, since:

  1. It delays app boot, causing more downtime on deploys and restarts
  2. It means for every dyno you have, each one is doing duplicate work (and potentially installing inconsistent versions; think race conditions with releases meaning different dynos running different versions of a package)
  3. If the install process fails for whatever reason (eg transient network issue), then the dyno will silently crash at runtime (rather than failing at build time more loudly, when a human can retrigger it)

The way to do this properly would be to either:

  1. Have a separate buildpack that runs after the Python buildpack, that does the PDM install (and just have PDM in the requirements.txt, which gets installed by the Python buildpack ready for the second buildpack)
  2. Just use the Python buildpack, have PDM in requirements.txt (as above), but then run PDM install via the bin/post_compile hook.
  3. Fork the Python buildpack and add native PDM support.

Regarding support in the Python buildpack for PDM - we'll have to see how PDM fares longer term (it's still newer and less popular than many of the other options). And even then, it would come after adding Poetry support (for which there is much more demand). Lastly, any new package manager support will be happening in the new CNB, rather than in this repo (which is for the classic buildpack, which will eventually be superseded by the CNB).

from heroku-buildpack-python.

tuergeist avatar tuergeist commented on June 9, 2024

@edmorley Thanks for the comments. I'd go with option 2 (post_compile) as option 1/3 need more effort on the long run. I don't want to become a maintainer for a product I pay for. Sorry.

from heroku-buildpack-python.

tuergeist avatar tuergeist commented on June 9, 2024

Just a note. A simple pdm install in post_compile does not work due to something the buildpack does later on. (not yet investigated)

from heroku-buildpack-python.

jefer94 avatar jefer94 commented on June 9, 2024

Exist any example how work CNB in this cases?

from heroku-buildpack-python.

tuergeist avatar tuergeist commented on June 9, 2024

Exist any example how work CNB in this cases?

@jefer94 What is CNB?

from heroku-buildpack-python.

Related Issues (20)

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.