Skip to content

Commit 03b5317

Browse files
committed
better
1 parent 7f5507b commit 03b5317

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

.github/workflows/tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@ jobs:
7171
- uses: actions/checkout@v6
7272
- uses: actions/setup-python@v6
7373
with:
74-
python-version: "3.15"
75-
allow-prereleases: true
76-
check-latest: true
74+
python-version: "3.14"
7775
- uses: astral-sh/setup-uv@v7
7876
with:
7977
version-file: "requirements-tests.txt"
8078
- run: uv pip install -r requirements-tests.txt --system
81-
- run: python ./tests/regr_test.py --all --verbosity QUIET --max-workers=8
79+
- run: python ./tests/regr_test.py --all --verbosity QUIET
8280

8381
pyright:
8482
name: "pyright: Run test cases"

tests/regr_test.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

382374
def 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

Comments
 (0)