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
DM-35917: Migrate config setting docs from pipe_base and update code to match expectations #199
Conversation
show = ShowInfo(kwargs.pop("show", [])) | ||
pipeline = script.build(**kwargs, show=show) | ||
if show.handled and not show.unhandled: | ||
# The show option was given and all options were processed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should print this to the user so they aren't confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, if the output from e.g. dump-config
is redirected to a file, it may also confuse something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can print to stderr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stderr is probably better than stdout, though we should probably ask users about what they want. I myself almost never use pipetask
, so my opinion probably should not count.
7619b97
to
d790409
Compare
Codecov Report
@@ Coverage Diff @@
## main #199 +/- ##
==========================================
+ Coverage 82.42% 83.35% +0.93%
==========================================
Files 47 48 +1
Lines 3755 3846 +91
Branches 676 690 +14
==========================================
+ Hits 3095 3206 +111
+ Misses 481 470 -11
+ Partials 179 170 -9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c635871
to
8100e02
Compare
1. Keep track of which options have been used. 2. No longer run the pipeline show options multiple times for pipetask qgraph. 3. No longer warn about options not being used when they are about to be used. 4. If --show is used, no longer continue on unless there are remaining --show options to process. The latter means that using `pipetask qgraph` with only pipeline show options exits without building the graph, and any use of --show leads to `pipetask run` not running anything.
This matches what the click option callback is doing itself and so ensures consitency in option handling.
1f8a19c
to
abd210a
Compare
Also added some additions.
This is easier to test and it is odd having a class be able to exit.
This makes it easier to test the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, few minor comments.
There is a non-zero chance that people might want to specify a command-line config option that includes a comma and it's safer to require people to use multiple --config options.
This makes it clear why the command finished without doing anything.
Whilst migrating some config docs from pipe_base I realized that the --show option was not working right. I ended up trying to fix it.
Checklist
doc/changes