From a56843fdd42417d16215060de84ca5637d0db2b7 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Fri, 20 Dec 2024 00:13:06 +0100 Subject: [PATCH] progress --- .github/workflows/bsd.yml | 4 +- .github/workflows/build.yml | 196 ++++++++++++++++++++---------------- 2 files changed, 112 insertions(+), 88 deletions(-) diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index c405e8228..3c9a6e3f3 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: freebsd: - # if: false + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -23,7 +23,7 @@ jobs: PIP_BREAK_SYSTEM_PACKAGES=1 make install-sysdeps install-pydeps-test install print-sysinfo test test-memleaks openbsd: - # if: false + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b85d39b13..d0776d80e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,102 +17,126 @@ concurrency: cancel-in-progress: true jobs: # Linux + macOS + Windows Python 3 - py3: - name: "py3, ${{ matrix.os }}, ${{ matrix.arch }}" - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - include: - - {os: ubuntu-latest, arch: x86_64} - - {os: ubuntu-latest, arch: i686} - - {os: ubuntu-latest, arch: aarch64} - - {os: macos-13, arch: x86_64} - - {os: macos-14, arch: arm64} - - {os: windows-2019, arch: AMD64} - - {os: windows-2019, arch: x86} - steps: - - uses: actions/checkout@v4 + # py3: + # name: "py3, ${{ matrix.os }}, ${{ matrix.arch }}" + # runs-on: ${{ matrix.os }} + # timeout-minutes: 30 + # strategy: + # fail-fast: false + # matrix: + # include: + # - {os: ubuntu-latest, arch: x86_64} + # - {os: ubuntu-latest, arch: i686} + # - {os: ubuntu-latest, arch: aarch64} + # - {os: macos-13, arch: x86_64} + # - {os: macos-14, arch: arm64} + # - {os: windows-2019, arch: AMD64} + # - {os: windows-2019, arch: x86} + # steps: + # - uses: actions/checkout@v4 - # see https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64 - - name: "Install python 3.8 universal2 on macOS arm64" - if: runner.os == 'macOS' && runner.arch == 'ARM64' - uses: actions/setup-python@v5 - env: - PIP_DISABLE_PIP_VERSION_CHECK: 1 - with: - python-version: 3.8 + # # see https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64 + # - name: "Install python 3.8 universal2 on macOS arm64" + # if: runner.os == 'macOS' && runner.arch == 'ARM64' + # uses: actions/setup-python@v5 + # env: + # PIP_DISABLE_PIP_VERSION_CHECK: 1 + # with: + # python-version: 3.8 - - uses: actions/setup-python@v5 - with: - python-version: 3.11 + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.11 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: matrix.arch == 'aarch64' + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # if: matrix.arch == 'aarch64' - - name: Create wheels + run tests - uses: pypa/cibuildwheel@v2.22.0 - env: - CIBW_ARCHS: "${{ matrix.arch }}" - CIBW_ENABLE: "cpython-prerelease" - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: - make -C {project} PYTHON="env python" PSUTIL_SCRIPTS_DIR="{project}/scripts" install-sysdeps install-pydeps-test install print-sysinfo test test-memleaks + # - name: Create wheels + run tests + # uses: pypa/cibuildwheel@v2.22.0 + # env: + # CIBW_ARCHS: "${{ matrix.arch }}" + # CIBW_ENABLE: "cpython-prerelease" + # CIBW_TEST_EXTRAS: test + # CIBW_TEST_COMMAND: + # make -C {project} PYTHON="env python" PSUTIL_SCRIPTS_DIR="{project}/scripts" install-sysdeps install-pydeps-test install print-sysinfo test test-memleaks - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-py3-${{ matrix.os }}-${{ matrix.arch }} - path: wheelhouse + # - name: Upload wheels + # uses: actions/upload-artifact@v4 + # with: + # name: wheels-py3-${{ matrix.os }}-${{ matrix.arch }} + # path: wheelhouse - - name: Generate .tar.gz - if: matrix.os == 'ubuntu-latest' - run: | - make generate-manifest - python setup.py sdist - mv dist/psutil*.tar.gz wheelhouse/ + # - name: Generate .tar.gz + # if: matrix.os == 'ubuntu-latest' + # run: | + # make generate-manifest + # python setup.py sdist + # mv dist/psutil*.tar.gz wheelhouse/ + + # Linux + macOS + Python 2 + py2: + name: py2, ${{ matrix.os }} + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + env: + CIBW_BUILD: 'cp27-*' + CIBW_TEST_EXTRAS: test + CIBW_TEST_COMMAND: + make -C {project} PYTHON="env python" python -V - # Run linters - linters: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.x - - name: 'Run linters' - run: | - python3 -m pip install ruff black rstcheck toml-sort sphinx - make lint-all + python-version: 3.9 - # upload weels as a single artefact - upload-wheels: - needs: [py3] - runs-on: ubuntu-latest - steps: - - uses: actions/upload-artifact/merge@v4 - with: - name: wheels - pattern: wheels-* - separate-directories: false - delete-merged: true + - name: Create wheels + run tests + uses: pypa/cibuildwheel@v1.12.0 - # Check sanity of .tar.gz + wheel files - check-dist: - needs: [upload-wheels] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse - - run: | - python scripts/internal/print_hashes.py wheelhouse/ - pipx run twine check --strict wheelhouse/* - pipx run abi3audit --verbose --strict wheelhouse/*-abi3-*.whl + # # Run linters + # linters: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.x + # - name: 'Run linters' + # run: | + # python3 -m pip install ruff black rstcheck toml-sort sphinx + # make lint-all + + # # upload weels as a single artefact + # upload-wheels: + # needs: [py3] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/upload-artifact/merge@v4 + # with: + # name: wheels + # pattern: wheels-* + # separate-directories: false + # delete-merged: true + + # # Check sanity of .tar.gz + wheel files + # check-dist: + # needs: [upload-wheels] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.x + # - uses: actions/download-artifact@v4 + # with: + # name: wheels + # path: wheelhouse + # - run: | + # python scripts/internal/print_hashes.py wheelhouse/ + # pipx run twine check --strict wheelhouse/* + # pipx run abi3audit --verbose --strict wheelhouse/*-abi3-*.whl