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
Missing user feedback for why publish was aborted when --no-interaction is set #351
When trying to run poetry publish on one of our projects with --no-interaction set, we see that the build fails with the error Aborted! and no additional information about why.
When we remove --no-interaction we see the message There are 2 files ready for publishing. Build anyway? (yes/no) [no] as expected.
It would have been nice if this message had been visible in our CI system's logs in the first place. Instead of suppressing the user prompt completely, can we print the question and append something on the end to indicate that we're selecting the default option because we are running non-interactively? E.g.,:
There are 2 files ready for publishing. Build anyway? (yes/no) [no]
WARNING: --no-interaction is set. Choosing the default answer!
Aborted!
Alternatively, change the error message Aborted! to something more descriptive.
Reacted by yigalk89, Ethan, Vince Chan, Frankie, Greg Najda, Jonathan Hiles, Joseph Henry, Jeff Stein, Salim and ctcq
Additionally, when --no-interaction is unset, if our CI system encounters this situation, it hangs forever, and the prompt never shows up in the console logs, even after aborting the build. This is what prompted us to start using --no-interaction in the first place.
I also have this issue.
I would expect the --no-interaction to be equivalent to typing 'yes' at the user prompt. Obviously it doesn't make sense to not use the --no-interaction flag in a CI system; that's what it's for.
It's possible that a more explicit flag like -y, similar to how apt-get -y install works could be clearer than --no-interaction in this case.
For me, I solved this by removing the build files before running publish with the --build option. Assuming the default dist directory:
+1 on this issue. Removing the dist/ dir certainly works, but it's pretty frustrating. It would be better to have an option to build only if build artifacts don't already exist.
Reacted by Jonathan Hiles, Jeff Stein and Andrey B.
It would also help if the --clean option that was added to the build command in Poetry v2.0 was also available for the publish command.
Then we could do poetry publish --clean --build in a single command.
Activity
mstandley-tempus commentedon Aug 10, 2023
Additionally, when
--no-interactionis unset, if our CI system encounters this situation, it hangs forever, and the prompt never shows up in the console logs, even after aborting the build. This is what prompted us to start using--no-interactionin the first place.chan-vince commentedon Feb 22, 2024
I also have this issue.
I would expect the
--no-interactionto be equivalent to typing 'yes' at the user prompt. Obviously it doesn't make sense to not use the--no-interactionflag in a CI system; that's what it's for.It's possible that a more explicit flag like
-y, similar to howapt-get -y installworks could be clearer than--no-interactionin this case.For me, I solved this by removing the build files before running publish with the
--buildoption. Assuming the defaultdistdirectory:While this works, I hope a future poetry release would either make
--no-interactionbe like typingyesat the prompt, or add a new-yflag.MatthewCane commentedon Apr 3, 2024
+1 on this issue. Removing the
dist/dir certainly works, but it's pretty frustrating. It would be better to have an option to build only if build artifacts don't already exist.psibre commentedon Feb 9, 2025
It would also help if the
--cleanoption that was added to thebuildcommand in Poetry v2.0 was also available for thepublishcommand.Then we could do
poetry publish --clean --buildin a single command.