Skip to content
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

Set global flags via global mechanisms (environment variable, config file) #1623

Open
2 tasks done
Newtopian opened this issue Nov 22, 2019 · 4 comments
Open
2 tasks done
Labels
area/cli Related to the command line kind/feature Feature requests/implementations

Comments

@Newtopian
Copy link

Newtopian commented Nov 22, 2019

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

When integrating poetry in a larger work of development loop automation and build system pipeline the same command will get run in different contexts.

As such some options would be better served if we could put them in configuration directly instead of having to modulate the command line calls.

Thus when running the script in an interactive session on the programmer's station poetry commands would be interactive with ansi coloring. but the very same script when run on an unattended build system would automatically receive --no-ansi --no-interaction global options if these were added in the poetry config already present on the build machine / docker image.

Same goes with the quiet and verbose flags and any other options that could affect all commands.

thanks

@Newtopian Newtopian added the kind/feature Feature requests/implementations label Nov 22, 2019
@Secrus
Copy link
Member

Secrus commented May 21, 2022

Hi, could you provide some examples of how that would work on the user end?

@Secrus Secrus added area/cli Related to the command line status/waiting-on-response Waiting on response from author labels May 21, 2022
@neersighted
Copy link
Member

neersighted commented Oct 4, 2022

Partially duplicates #1132, but there is an argument for adding some flags as environment variables as well. I don't think they make sense in config.toml, but I'm prepared to hear other opinions too.

@neersighted neersighted changed the title Add global opts as configuiration elements Set global flags via global mechanisms (environment variable, config file) Oct 4, 2022
@mazinesy
Copy link

mazinesy commented Jan 4, 2023

@Secrus it is me again 😄 . I was about to create this exact issue.

We run poetry install --sync on our CI before running tests. Here's what happens:

  1. Project has a set of n dependencies.
  2. CI runs smoothly
  3. We update some dependencies in the project and create the PR
  4. CI runs poetry install --sync, finds some changes to make.
  5. CI fails

What I tried is running : poetry install --sync || true, this made the CI go to the next step. My suspicion is that the ANSI and the dynamic change of the dependency status when running poetry install seems to not work under CI conditions.

I was able to make everything run properly by adding the --no-ansi (and --no-interaction, but that is not what solved the issue). Given the automation we have in our workplace, it is critical for us to be able to have this as a global config flag as everyone would expect poetry install --sync to work in all environments which is currently not the case.

@neersighted
Copy link
Member

That sounds like a variant of #7184 -- that being said, the solution really needs to be fixing the bug that causes Poetry to die without useful output, and not a better way to set a flag that happens to be a workaround.

It's certainly true that this is nice to have, but I don't think that the fact that there's a nasty bug involving Cleo-decorated output right now means that it's suddenly more urgent to make a workaround more ergonomic (as opposed to just fixing the bug itself).

@finswimmer finswimmer removed the status/waiting-on-response Waiting on response from author label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to the command line kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

5 participants