-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Deploy app on Heroku using Poetry #403
Comments
IMO, the best solution would be to update the Python buildpack to key off |
This would work too #100 |
I have a more general solution to this, if I may, I had begun working on a patch, but I'm still familiarising myself with the poetry package. We need to use pip directly on EC2 instances and I threw together a solution to generate a traditional requirements.txt file, but using a make rule, ideally a command to regenerate a standard requirements.txt file for use with heroku/aws etc would be a good way to integrate quickly and easily with existing services etc, I wrote up kinda what we're doing here: http://neilmunro.herokuapp.com/blog/python_development_and_production_workflow Something like:
|
Yet another pipenv refugee here... Would be great to have an analog to In the meantime, we are thinking of running |
An |
@sdispater sounds awesome! Would be great if that |
Merged in develop in #675, yay! 👍 Will be testing when it hits the next release. |
Hey folks, could someone summarize the steps to deploy using poetry? |
@woile the feature has been merged in In the meantime, we use an internal tool that we have written to the same effect, which parses the lock-file and outputs |
@woile If you don't care about leveraging Heroku's dependency cache, the following works for a Django project using the default Python buildpack:
poetry==1.0.2
#!/usr/bin/env bash
set -eo pipefail
indent() {
sed "s/^/ /"
}
puts-step() {
echo "-----> $@"
}
puts-step "Installing dependencies with poetry..."
poetry config virtualenvs.create false 2>&1 | indent
poetry install --no-dev 2>&1 | indent
puts-step "Collecting static files..."
python manage.py collectstatic --no-input 2>&1 | indent |
The |
@jacebrowning i disagree with how heroku's dependency cache works anyways, so this is actually OK with me 😆 |
Using I modified my install for a flask-app to allow poetry to keep its virtual env, but just in the repo
#!/usr/bin/env bash
set -eo pipefail
indent() {
sed "s/^/ /"
}
puts-step() {
echo "-----> $@"
}
puts-step "Installing dependencies with poetry..."
# Use a venv, but install locally
poetry config settings.virtualenvs.in-project true 2>&1 | indent
poetry install --no-dev 2>&1 | indent
# Not using Django
# puts-step "Collecting static files..."
# python manage.py collectstatic --no-input 2>&1 | indent This requires the Procfile to be mangled, as the script to launch gunicorn (
|
I got it working (for poetry 1.0.0) by adding # Get poetry from source
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
# Make poetry available to $PATH
source $HOME/.poetry/env
# Export poetry packages to requirements.txt to be used for installing the pipy packages
poetry export -f requirements.txt -o requirements.txt pre_compile will be made executable by the buildpack: |
Now that poetry 1.0.0 is out, you can run |
As of Poetry 1.0,
has changed to
Could you help update it to help future readers? Also, it's better to use |
FYI, we've eventually created a buildpack and moved to Poetry also on Heroku: https://github.com/moneymeets/python-poetry-buildpack /cc @marns93 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Question
Let say you have a simple Flask web app but instead of using pipenv (or regular pip + requirements.txt) I want to use poetry. How do I deploy this app on heroku?
With pipenv it is easy because there already exists a buildpack for pipenv but it does not for poetry.
The text was updated successfully, but these errors were encountered: