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
{{ message }}
Repository navigation
1.2.x version regression: when install called multiple times with different "extras", then "extras" from previous step are removed #5895
In the past, I was able to use Docker multi-stage builds:
FROM python:3.10-slim-bullseye as base
# Install only main dependenciesRUN poetry install --no-interaction --no-ansi --no-root --no-dev
FROM base as testing
# We have runtime dependencies, now add only "dev" dependenciesRUN poetry install --no-interaction --no-ansi --no-root
FROM base as deploy
# We have runtime dependencies, now add only cloud dependenciesRUN poetry install --no-interaction --no-ansi --no-root --no-dev -E cloud_deploy
In other words, I was able to add more and more "extras" on every CI/CD step. Since 1.2.x version such behavior is broken and I see no workarounds.
changed the title [-]1.2.x version regression: when `install` called multiple times with different "extras", previous "extras" are removed[/-][+]1.2.x version regression: when `install` called multiple times with different "extras", then "extras" from previous step are removed[/+]on Jun 22, 2022
The 1.2 behaviour seems like an improvement to me. If you want to install more than one set of extras then, per the help
-E (--extras) Extra sets of dependencies to install. (multiple values allowed)
multiple values are allowed
Multiple values were allowed in 1.1.x. You are talking about a different thing.
I need to install more and more extras during multiple CI/CD stages. Can you see the difference between installing multiple extras at once and installing multiple extras by calling poetry install multiple times? The second option is what I need:
CI stage 1:
poetry install -E base
CI stage 2:
poetry install -E foobar
CI stage 3:
poetry install -E cloud_deploy
# At the end I must have "base foobar cloud_deploy". All selected extras!
Of course I can always install -E "foo bar spam eggs" at the start, but this is not what I need. E.g. I do not need cloud dependencies for my unit tests. I need to add cloud dependencies as an extra later, but I need to keep all other extras that I've installed at the beginning.
stage 1 install foo, stage 2 install foo + bar, stage 3 install foo + bar + baz?
Yes, exactly. I can do as you wrote, but this will result in more boilerplate code inside Dockerfile multi-stages. I will need to copy/paste specific extras again and again in every Dockerfile stage.
I am fine with the current (new) Poetry behavior, but it must be documented. Of course, if you say that this is a feature and not a bug.
I'm surprised of this behaviour. Often I find myself needing to use a feature provided by some extra, which I would like to just add to my current environment. I might not even know or remember what other extras I have already installed, but I would like to still have them.
How about adding an option --keep-existing that would retain the already installed extras (or simply any dependencies) when installing new ones?
(Issue #6229 discusses the same and its linked PR #6432 improves related documentation.)
Activity
[-]1.2.x version regression: when `install` called multiple times with different "extras", previous "extras" are removed[/-][+]1.2.x version regression: when `install` called multiple times with different "extras", then "extras" from previous step are removed[/+]dimbleby commentedon Jun 22, 2022
The 1.2 behaviour seems like an improvement to me. If you want to install more than one set of extras then, per the help
multiple values are allowed
simon-liebehenschel commentedon Jun 22, 2022
Multiple values were allowed in 1.1.x. You are talking about a different thing.
I need to install more and more extras during multiple CI/CD stages. Can you see the difference between installing multiple extras at once and installing multiple extras by calling
poetry installmultiple times? The second option is what I need:Of course I can always install
-E "foo bar spam eggs"at the start, but this is not what I need. E.g. I do not need cloud dependencies for my unit tests. I need to add cloud dependencies as an extra later, but I need to keep all other extras that I've installed at the beginning.dimbleby commentedon Jun 22, 2022
stage 1 install foo, stage 2 install foo + bar, stage 3 install foo + bar + baz?
simon-liebehenschel commentedon Jun 22, 2022
Yes, exactly. I can do as you wrote, but this will result in more boilerplate code inside Dockerfile multi-stages. I will need to copy/paste specific extras again and again in every Dockerfile stage.
I am fine with the current (new) Poetry behavior, but it must be documented. Of course, if you say that this is a feature and not a bug.
dimbleby commentedon Jun 22, 2022
An MR updating the docs would be welcome I'm sure. I've been trying to help you with
... and I think we're done.
juhoinkinen commentedon Sep 12, 2022
I'm surprised of this behaviour. Often I find myself needing to use a feature provided by some extra, which I would like to just add to my current environment. I might not even know or remember what other extras I have already installed, but I would like to still have them.
How about adding an option
--keep-existingthat would retain the already installed extras (or simply any dependencies) when installing new ones?(Issue #6229 discusses the same and its linked PR #6432 improves related documentation.)
neersighted commentedon Sep 12, 2022
Not a bug / docs are updated by #6432.
github-actions commentedon Mar 1, 2024
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.