-
Notifications
You must be signed in to change notification settings - Fork 88
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
Upgrading Python can break Poetry #54
Comments
This buildpack wasn't designed with making Poetry useful after it's finished in mind, but I admit that it was never made explicit. It merely does an intermediate processing step of converting Poetry lock into Solving this problem would indeed require a separate Python installation as you suggest, so that Heroku doesn't pull stuff under our feet. This is not something we are interested in addressing. But maybe we can update the README to make it clearer. Any suggestions? To solve your problem I would actually suggest to follow the recommended Poetry installation steps inside the CI environment: export POETRY_HOME=/app/poetry
curl -sSL https://install.python-poetry.org | python3 -
$POETRY_HOME/bin/poetry --version https://python-poetry.org/docs/#installing-with-the-official-installer This way you should be able to land with a useful Poetry installation for your CI purposes. |
That makes a lot of sense, we'll do that! I would say something like
|
@vlmphipps thank you! |
Steps to reproduce
heroku/python
to deploy a Python project to Heroku.poetry
commands in the CI checks:Expected behavior
Poetry installs and generates a requirements.txt and runtime.txt, Heroku installs Python version 3.11.1 and the requirements.txt packages, Poetry's checks succeed.
Actual behavior
Poetry installs and generates a requirements.txt and runtime.txt, Heroku installs Python version 3.11.1 and the requirements.txt packages, Poetry's checks fail with an error like this:
Hypothesis
Poetry is installed into its venv using the Heroku default Python for
heroku-22
which is 3.10.9. Onceheroku/python
switches to 3.11.1, the 3.10.9 installation is deleted, which breaks the Poetry venv.Suggested solution
In this buildpack, use
pyenv
to install an isolated Python that Poetry can use and rely on. Related to the discussion here: heroku/heroku-buildpack-python#796 (comment)I'm not sure how to do this in a way that plays nicely with Heroku's caching and stuff. I haven't made a buildpack of my own before.
Workaround
Do not upgrade to 3.11.
The text was updated successfully, but these errors were encountered: