diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 556ffd1a1f..36ce9b7bd9 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -41,8 +41,8 @@ jobs: id: get_num_cores shell: python run: | - from os import environ, sched_getaffinity - num_cpus = len(sched_getaffinity(0)) + from os import environ, cpu_count + num_cpus = cpu_count() output_file = environ['GITHUB_OUTPUT'] with open(output_file, "a", encoding="utf-8") as output_stream: output_stream.write(f"count={num_cpus}\n") @@ -80,9 +80,9 @@ jobs: VCPKG_DEFAULT_TRIPLET=x64-windows-static-md VCPKG_FEATURE_FLAGS=manifests,registries CMAKE_GENERATOR="Visual Studio 17 2022" - CMAKE_GENERATOR_PLATFORM=x64' - CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.get_num_cores.outputs.num_cpus }} - CIBW_ARCHS: "AMD64" + CMAKE_GENERATOR_PLATFORM=x64 + CMAKE_BUILD_PARALLEL_LEVEL=${{ steps.get_num_cores.outputs.num_cpus }} + CIBW_ARCHS: AMD64 CIBW_BEFORE_BUILD: python -m pip install setuptools wheel # skip CasADi and CMake CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"