feat(cli): add option for a single output-dir and hide options#905
feat(cli): add option for a single output-dir and hide options#905sejohnst wants to merge 1 commit intopython-wheel-build:mainfrom
Conversation
Signed-off-by: Sean Johnston <sejohnst@redhat.com>
9d4945f to
05c4700
Compare
| "-t", | ||
| "--work-dir", | ||
| default=pathlib.Path("work-dir"), | ||
| "-d", |
There was a problem hiding this comment.
Maybe -O (to avoid conflicting with -o but to match "output" instead of "dir")?
| default=pathlib.Path("work-dir"), | ||
| "-d", | ||
| "--output-dir", | ||
| default=None, |
There was a problem hiding this comment.
I think we want this to be ".", then we would change some logic below for dealing with defaults.
| "-o", | ||
| "--sdists-repo", | ||
| type=clickext.ClickPath(), | ||
| default=pathlib.Path("sdists-repo"), |
There was a problem hiding this comment.
I think we want the defaults for all of these old options to be None so we can tell if the user provided values.
| self.constraints.load_constraints_file(constraints_file) | ||
| else: | ||
| self.input_constraints_uri = None | ||
| if output_dir is not None: |
There was a problem hiding this comment.
Here I would have a separate check for each variable. Something like
if not sdists_repo:
sdists_repo = output_dir / "sdists-repo"
With all of those changes in place, if the user passes no arguments we get "./sdists-repo" for the sdists_repo variable. If they pass -O foo then we get "foo/sdists-repo". If they pass --sdists-repo blah then we get "blah". That gives us backwards compatibility, while emphasizing the use of -O on the command line.
Fixes #721