6767 type = clickext .ClickPath (),
6868 help = "save error messages to a file" ,
6969)
70+ @click .option (
71+ "-O" ,
72+ "--output-dir" ,
73+ default = pathlib .Path ("." ),
74+ type = clickext .ClickPath (),
75+ help = "base directory for sdists-repo, wheels-repo, and work-dir (default: current directory)" ,
76+ )
7077@click .option (
7178 "-o" ,
7279 "--sdists-repo" ,
73- default = pathlib . Path ( "sdists-repo" ) ,
80+ default = None ,
7481 type = clickext .ClickPath (),
75- help = "location to manage source distributions" ,
82+ hidden = True ,
83+ help = "location to manage source distributions (overrides --output-dir)" ,
7684)
7785@click .option (
7886 "-w" ,
7987 "--wheels-repo" ,
80- default = pathlib . Path ( "wheels-repo" ) ,
88+ default = None ,
8189 type = clickext .ClickPath (),
82- help = "location to manage wheel repository" ,
90+ hidden = True ,
91+ help = "location to manage wheel repository (overrides --output-dir)" ,
8392)
8493@click .option (
8594 "--build-wheel-server-url" ,
8897@click .option (
8998 "-t" ,
9099 "--work-dir" ,
91- default = pathlib . Path ( "work-dir" ) ,
100+ default = None ,
92101 type = clickext .ClickPath (),
93- help = "location to manage working files, including builds and logs" ,
102+ hidden = True ,
103+ help = "location to manage working files, including builds and logs (overrides --output-dir)" ,
94104)
95105@click .option (
96106 "-p" ,
@@ -159,10 +169,11 @@ def main(
159169 log_file : pathlib .Path ,
160170 log_format : str ,
161171 error_log_file : pathlib .Path ,
162- sdists_repo : pathlib .Path ,
163- wheels_repo : pathlib .Path ,
172+ output_dir : pathlib .Path ,
173+ sdists_repo : pathlib .Path | None ,
174+ wheels_repo : pathlib .Path | None ,
164175 build_wheel_server_url : str ,
165- work_dir : pathlib .Path ,
176+ work_dir : pathlib .Path | None ,
166177 patches_dir : pathlib .Path ,
167178 settings_file : pathlib .Path ,
168179 settings_dir : pathlib .Path ,
@@ -177,6 +188,15 @@ def main(
177188 global _DEBUG
178189 _DEBUG = debug
179190
191+ # Resolve output directories: explicit per-directory flags take
192+ # precedence, otherwise derive from --output-dir.
193+ if not sdists_repo :
194+ sdists_repo = output_dir / "sdists-repo"
195+ if not wheels_repo :
196+ wheels_repo = output_dir / "wheels-repo"
197+ if not work_dir :
198+ work_dir = output_dir / "work-dir"
199+
180200 # Set custom log factory to prepend requirement name.
181201 logging .setLogRecordFactory (log .FromagerLogRecord )
182202 # Set the overall logger level to debug and allow the handlers to filter
0 commit comments