@@ -107,13 +107,6 @@ class Verbosity(IntEnum):
107107 "Note that this cannot be specified if --all is also specified."
108108 ),
109109)
110- parser .add_argument (
111- "-j" ,
112- "--max-workers" ,
113- type = int ,
114- default = os .cpu_count (),
115- help = "Maximum number of packages or mypy subprocesses to run concurrently" ,
116- )
117110
118111_PRINT_QUEUE : queue .SimpleQueue [str ] = queue .SimpleQueue ()
119112
@@ -305,7 +298,6 @@ def concurrently_run_testcases(
305298 verbosity : Verbosity ,
306299 platforms_to_test : list [str ],
307300 versions_to_test : list [str ],
308- max_workers : int | None ,
309301) -> list [Result ]:
310302 packageinfo_to_tempdir = {
311303 distribution_info : Path (stack .enter_context (tempfile .TemporaryDirectory ())) for distribution_info in testcase_directories
@@ -356,7 +348,7 @@ def cleanup_threads(
356348 printer_thread = threading .Thread (target = print_queued_messages , args = (event ,))
357349 printer_thread .start ()
358350
359- with concurrent .futures .ThreadPoolExecutor (max_workers = max_workers ) as executor :
351+ with concurrent .futures .ThreadPoolExecutor (max_workers = os . cpu_count () ) as executor :
360352 # Each temporary directory may be used by multiple processes concurrently during the next step;
361353 # must make sure that they're all setup correctly before starting the next step,
362354 # in order to avoid race conditions
@@ -381,8 +373,6 @@ def cleanup_threads(
381373
382374def main () -> ReturnCode :
383375 args = parser .parse_args ()
384- if args .max_workers is not None and args .max_workers < 1 :
385- parser .error ("--max-workers must be a positive integer" )
386376
387377 testcase_directories = args .packages_to_test or get_all_testcase_directories ()
388378 verbosity = Verbosity [args .verbosity ]
@@ -399,9 +389,7 @@ def main() -> ReturnCode:
399389 results : list [Result ] | None = None
400390
401391 with ExitStack () as stack :
402- results = concurrently_run_testcases (
403- stack , testcase_directories , verbosity , platforms_to_test , versions_to_test , args .max_workers
404- )
392+ results = concurrently_run_testcases (stack , testcase_directories , verbosity , platforms_to_test , versions_to_test )
405393
406394 assert results is not None
407395 if not results :
0 commit comments