You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+1 on poetry, however, I am not sure how to go about deployment with it, might have to generate a requirements.txt for that
Poetry might generate requirements.txt out of the box since 1.0 version for docker install or PyCharm indexing and etc. In case of pipfile you need a another tool as requirementslib for this
I have modified my project to use poetry, and I changed the dockerfiles to do the following:
COPY ./backend/app/pyproject.toml ./backend/app/poetry.lock /app/
RUN cd /app &&$HOME/.poetry/bin/poetry config virtualenvs.create false&&$HOME/.poetry/bin/poetry install
The config virtualenvs.create false part disables the use/creation of a venv by poetry, so it installs everything in the "main" python inside the docker images. While not required, I feel that using the same tool everywhere makes more sense.
As a side note, I use a custom base image with most of my python dependencies in it to save time in CI, and there is a bug in poetry that reinstalls everything even if included in the base image, but it still works.
I'll create a PR for this, most likely this week. @tiangolo what do you think about also changing backend.dockerfile to install dependencies using Poetry instead of raw pip install ...?
Activity
jlugao commentedon Mar 2, 2020
+1 on poetry, however, I am not sure how to go about deployment with it, might have to generate a requirements.txt for that
RCheese commentedon Mar 2, 2020
Poetry might generate requirements.txt out of the box since 1.0 version for docker install or PyCharm indexing and etc. In case of pipfile you need a another tool as requirementslib for this
StephenBrown2 commentedon Mar 2, 2020
Like @RCheese said (but with links), Poetry 1.x will generate a requirements.txt:
https://python-poetry.org/docs/cli/#export
RCheese commentedon Mar 2, 2020
I wrote the same)
laurentS commentedon Mar 19, 2020
I have modified my project to use
poetry, and I changed the dockerfiles to do the following:The
config virtualenvs.create falsepart disables the use/creation of a venv by poetry, so it installs everything in the "main" python inside the docker images. While not required, I feel that using the same tool everywhere makes more sense.As a side note, I use a custom base image with most of my python dependencies in it to save time in CI, and there is a bug in poetry that reinstalls everything even if included in the base image, but it still works.
lucawen commentedon Apr 6, 2020
this will be really great and simple to change!
tiangolo commentedon Apr 13, 2020
Yep. I want to migrate this to Poetry 😄
I just haven't had the time yet.
mrbox commentedon Apr 15, 2020
I'll create a PR for this, most likely this week. @tiangolo what do you think about also changing
backend.dockerfileto install dependencies using Poetry instead of rawpip install ...?tiangolo commentedon Apr 18, 2020
We now have Poetry, and it's integrated into the
Dockerfilesas well. 🚀Thanks @RCheese for the idea and PR!
Version-control `poetry.lock` with Git
✅ Reset password tests (#123)
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git
Version-control `poetry.lock` with Git