Files
klubhaus-doorbell/libraries/FastLED/ci/util/cpu_count.py
2026-02-12 00:45:31 -08:00

13 lines
327 B
Python

import os
def cpu_count() -> int:
"""Get the number of CPUs."""
# Force sequential execution if NO_PARALLEL is set
if "GITHUB_ACTIONS" in os.environ:
return 1
no_parallel = os.environ.get("NO_PARALLEL", "0") in ["1", "true", "True"]
if no_parallel:
return 1
return os.cpu_count() or 1