@@ -316,16 +316,6 @@ def _transform_to_stub(task):
316316 "structure under PACKAGE_PATH. "
317317 "Otherwise, stubs are generated inplace." ,
318318)
319- @click .option (
320- "--config" ,
321- "config_paths" ,
322- type = click .Path (exists = True , dir_okay = False ),
323- metavar = "PATH" ,
324- multiple = True ,
325- help = "Set one or more configuration file(s) explicitly. "
326- "Otherwise, it will look for a `pyproject.toml` or `docstub.toml` in the "
327- "current directory." ,
328- )
329319@click .option (
330320 "--ignore" ,
331321 type = str ,
@@ -361,16 +351,28 @@ def _transform_to_stub(task):
361351@click .option (
362352 "--workers" ,
363353 "desired_worker_count" ,
364- type = click .IntRange (min = 1 ),
354+ type = int ,
355+ default = 1 ,
365356 metavar = "INT" ,
366- help = "Set the number of workers to process files in parallel. "
367- "By default docstub will attempt to choose an appropriate number." ,
357+ help = "Experimental: Process files in parallel with the desired number of workers. "
358+ "By default, no multiprocessing is used." ,
359+ show_default = True ,
368360)
369361@click .option (
370362 "--no-cache" ,
371363 is_flag = True ,
372364 help = "Ignore pre-existing cache and don't create a new one." ,
373365)
366+ @click .option (
367+ "--config" ,
368+ "config_paths" ,
369+ type = click .Path (exists = True , dir_okay = False ),
370+ metavar = "PATH" ,
371+ multiple = True ,
372+ help = "Set one or more configuration file(s) explicitly. "
373+ "Otherwise, it will look for a `pyproject.toml` or `docstub.toml` in the "
374+ "current directory." ,
375+ )
374376@_add_verbosity_options
375377@click .help_option ("-h" , "--help" )
376378@log_execution_time ()
@@ -404,7 +406,7 @@ def run(
404406 group_errors : bool
405407 allow_errors : int
406408 fail_on_warning : bool
407- desired_worker_count : int | None
409+ desired_worker_count : int
408410 no_cache : bool
409411 verbose : int
410412 quiet : int
@@ -480,7 +482,7 @@ def run(
480482 task_count = len (task_args )
481483
482484 worker_count , chunk_size = guess_concurrency_params (
483- task_count = task_count , worker_count = desired_worker_count
485+ task_count = task_count , desired_worker_count = desired_worker_count
484486 )
485487
486488 logger .info ("Using %i parallel jobs to write %i stubs" , worker_count , task_count )
0 commit comments