Heroku buildpacks for Python (version 20 or 22) do not yet support PDM out of the box. (See Heroku docs)
This repo provides a workaround.
This example provides a requirements.txt with just pdm in it. The Procfile installs the environment from pyproject.toml and runs the service (unicorn-fastapi)
- checkout the repo
- cd into the repo
rm -rf .git
- then you can create a new git repo with
git init .
- add your code
git add .
git commit -m 'initial'
- configure heroku
heroku create example-pdm-app-foobar
heroku git:remote -a example-pdm-app-foobar
git push heroku main
will deploy the appheroku logs --tail
to see the logfiles