Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the PDM package manager #1341

Open
jefer94 opened this issue Jul 31, 2022 · 7 comments
Open

Support the PDM package manager #1341

jefer94 opened this issue Jul 31, 2022 · 7 comments

Comments

@jefer94
Copy link

jefer94 commented Jul 31, 2022

I have a project in python with pipenv it recently can do anything less resolve dependencies, I want to change it with PDM but does not exists material says whats package manager is supported ( https://devcenter.heroku.com/articles/buildpacks ) this can mean or not is supported or does not exists docs about it, I think this package manager is a good choise for the new projects

@tuergeist
Copy link

@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.

@jefer94
Copy link
Author

jefer94 commented Aug 4, 2022

That look good

@edmorley
Copy link
Member

edmorley commented Aug 4, 2022

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).

@edmorley edmorley changed the title Support for PDM or write the docs about it Support the PDM package manager Aug 4, 2022
@tuergeist
Copy link

tuergeist commented Aug 5, 2022

@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.

@tuergeist
Copy link

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

@jefer94
Copy link
Author

jefer94 commented Aug 14, 2022

Exist any example how work CNB in this cases?

@tuergeist
Copy link

Exist any example how work CNB in this cases?

@jefer94 What is CNB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants