Comments (7)
@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.
That look good
from heroku-buildpack-python.
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:
- It delays app boot, causing more downtime on deploys and restarts
- 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)
- 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:
- 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) - Just use the Python buildpack, have PDM in
requirements.txt
(as above), but then run PDM install via thebin/post_compile
hook. - 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.
@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.
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.
Exist any example how work CNB in this cases?
from heroku-buildpack-python.
Exist any example how work CNB in this cases?
@jefer94 What is CNB?
from heroku-buildpack-python.
Related Issues (20)
- PYPY36 and PYPY27 is not available for stack (heroku-22) HOT 3
- Python 3.10.5 buildpack run results in "error while loading shared libraries: libpython3.10.so.1.0" HOT 6
- Add warning when using `tensorflow` rather than `tensorflow-cpu`
- Simple Django project deploys successfully on v218, fails on v219 and following HOT 2
- Possible out-of-date setuptools /wheel versions HOT 4
- upgrade to stack heroku-22 using python version 3.6.7. is it possible? HOT 2
- Problem trying to deploy in heroku-22 anyjson setup command: use_2to3 is invalid. HOT 2
- Heroku problem with redis conection HOT 1
- pipenv cache is skipped when it should not be HOT 3
- Error running locally built image with pack: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding HOT 4
- Can I change the python source? HOT 1
- `Requested runtime 'python-3.X.Y' is not available for this stack` due to hitting curl connection timeouts on Dokku HOT 3
- Add support for config vars in Pip requirements files HOT 4
- Could not install packages due to an EnvironmentError: Could not find a suitable TLS CA certificate bundle, HOT 4
- Python buildpack fails to deploy without first purging cache HOT 3
- Streamlit application w Anaconda requirements to be deployed w Heroku HOT 2
- Pipenv install is skipped in cases where it's not safe to do so
- Source repos for editable Pipenv VCS installs are not cached between builds
- Heroku deployment is incompatible with VCS-based versioning using `setuptools-scm` and friends HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroku-buildpack-python.