From 39b9ad53d09a64e8afdd1f4117be0871a4b36e22 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 25 Dec 2021 19:40:53 +0100 Subject: [PATCH] chore: update cibuildwheel This commit updates the build workflow to use the latest cibuildwheel as a GitHub Action. cibuildwheel configuration is now in its own file (as there's no `pyproject.toml` yet) Signed-off-by: mayeut --- .github/workflows/build.yml | 28 +++++----------------------- .gitignore | 1 + cibuildwheel.toml | 10 ++++++++++ 3 files changed, 16 insertions(+), 23 deletions(-) create mode 100644 cibuildwheel.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7d3c42240..540cd6b597 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,17 +28,7 @@ jobs: strategy: fail-fast: false matrix: - # os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-12] - include: - - {name: Linux, python: '3.9', os: ubuntu-latest} - env: - CIBW_TEST_COMMAND: - PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py && - PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py - CIBW_TEST_EXTRAS: test - CIBW_BUILD: 'cp36-* cp37-* cp38-* cp39-* cp310-*' - CIBW_SKIP: '*-musllinux_*' steps: - name: Cancel previous runs @@ -53,16 +43,10 @@ jobs: cache: pip cache-dependency-path: .github/workflows/build.yml - - name: Install cibuildwheel - run: pip install cibuildwheel - - # - name: (Windows) install Visual C++ for Python 2.7 - # if: matrix.os == 'windows-latest' - # run: | - # choco install vcpython27 -f -y - - name: Run tests - run: cibuildwheel . + uses: pypa/cibuildwheel@v2.10.2 + with: + config-file: "./cibuildwheel.toml" - name: Create wheels uses: actions/upload-artifact@v3 @@ -73,6 +57,7 @@ jobs: - name: Print hashes if: matrix.os == 'ubuntu-latest' run: | + pip install -U wheel make generate-manifest python setup.py sdist mv dist/psutil*.tar.gz wheelhouse/ @@ -87,16 +72,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-12] - include: - - {name: Linux, python: '3.9', os: ubuntu-latest} env: - CIBW_ARCHS_LINUX: 'x86_64 i686' CIBW_TEST_COMMAND: PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py && PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py CIBW_TEST_EXTRAS: test CIBW_BUILD: 'cp27-*' - CIBW_SKIP: '*-musllinux_*' steps: - name: Cancel previous runs @@ -126,6 +107,7 @@ jobs: - name: Print hashes if: matrix.os == 'ubuntu-latest' run: | + pip install -U wheel make generate-manifest python setup.py sdist mv dist/psutil*.tar.gz wheelhouse/ diff --git a/.gitignore b/.gitignore index 3d22b0b355..ddafc64c6a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ syntax: glob .tox/ build/ dist/ +wheelhouse/ diff --git a/cibuildwheel.toml b/cibuildwheel.toml new file mode 100644 index 0000000000..0e7b3b9741 --- /dev/null +++ b/cibuildwheel.toml @@ -0,0 +1,10 @@ +[tool.cibuildwheel] +skip = ["pp*", "*-musllinux*"] +test-extras = "test" +test-command = [ + "PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/runner.py", + "PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python {project}/psutil/tests/test_memleaks.py" +] + +[tool.cibuildwheel.macos] +archs = ["x86_64", "arm64"]