-
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
Have the poetry show --outdated
result reflected in its exit code for automation/CI
#3827
Comments
We would love to see this feature as well. We currently do the CI checking with What are the thoughts of the maintainers regarding this? |
Some thoughts about it: Probably, such a feature would cause Further, I think it feels weird if a show command returns a non-zero exit code when it shows what it should. It's more like a check, isn't it? I don't yet have a clear idea what a clean user interface would look like. 🤷♂️
If I understand this correctly, you rely on |
The Linux Given that the text is currently already showing in red, the color of errors, the error code could make sense. Regarding your first point about the performance: I do not see the performance problem. Poetry already shows different colors based on the updatability of a package. The only thing we would need to do is “if printed something red then exit code 1”. For now working with the console output or updated lock file is fine, just a bit cumbersome compared to a single command. Curious about your thoughts! |
Good references. So a non-zero exit code might be ok.
The meaning seems to be different: poetry/src/poetry/console/commands/show.py Lines 261 to 265 in b91531e
If I do not misinterpret the code, the color is red if it's a minor version bump and yellow if it's a major version bump. The color only tells if an update is semver safe. It does not say anything about the update being possible considering all dependencies. Further, even if you can't update to the latest version, an update to a more recent version may still be possible. |
Hmm I did not inspect the code. From my personal output and the example from @rhtenhove it seemed like the color is dependent on whether the dependency is constrained by some other dependency. Your snippet seems to be in line with your interpretation. I’ll experiment a bit more with it today. If you are right, then this feature would indeed add complexity. Maybe it makes more sense to add a similar feature to |
I was indeed wrong about the colors of the output. After taking a closer look at our own output, it indeed reflected the code snippet posted above. Maybe we could adapt poetry update then instead? |
Yeah, it might be better to add such an option to
|
That sounds good indeed. So a PR would then consist of
@radoering do you agree? |
In my opinion, that sounds reasonable. However, I think opinions of other core members on this flag are required. |
Just curious if there's anything I can use that will work in CICD? Currently happy to maintain a workaround whilst the decision is made here :) As it stands I've modified https://github.com/FHPythonUtils/CheckRequirements for me to use going forwards (and if anyone else finds it useful) |
Feature Request
Poetry has an excellent way of showing packages which are outdated, but are either required to be outdated (as dependencies), or just plain outdated.
For example, here we have poetry installed, which depends on requests, which in turn depends on an outdated
idna
. We also have an outdated version ofdocker
installed:I'd like to be able to distinguish in a CI job if there are any packages outdated that can be updated, by result of a non zero exit code from running
poetry show --outdated
. This should then have a zero exit code when dependencies need to stay outdated.This would be very useful in keeping things up to date, without having to do any manual work, and having a CI job keep watch on that for me.
The text was updated successfully, but these errors were encountered: