Skip to content

Commit

Permalink
chore: update cibuildwheel
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mayeut committed Oct 8, 2022
1 parent 0707c16 commit f50ebab
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,15 @@
on: [push, pull_request]
name: build
jobs:
# Linux + macOS + Python 3
# Linux + macOS + Python 3.6+
linux-macos-py3:
name: ${{ matrix.os }}-py3
name: ${{ matrix.os }}-py36-plus
runs-on: ${{ matrix.os }}
timeout-minutes: 20
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
Expand All @@ -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/[email protected]
with:
config-file: "./cibuildwheel.toml"

- name: Create wheels
uses: actions/upload-artifact@v3
Expand All @@ -73,30 +57,28 @@ 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/
python scripts/internal/print_hashes.py wheelhouse/
# Linux + macOS + Python 2
# Linux + macOS + Python 2.7 & 3.5
linux-macos-py2:
name: ${{ matrix.os }}-py2
name: ${{ matrix.os }}-py27-py35
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
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_*'
CIBW_BUILD: 'cp27-* cp35-*'
CIBW_SKIP: 'cp35-macosx_x86_64'

steps:
- name: Cancel previous runs
Expand Down Expand Up @@ -126,6 +108,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/
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ syntax: glob
.tox/
build/
dist/
wheelhouse/
10 changes: 10 additions & 0 deletions cibuildwheel.toml
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit f50ebab

Please sign in to comment.