Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Upload wheels as release assets #11

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions .ci/appveyor/install.ps1

This file was deleted.

118 changes: 84 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# * Linux
# * macOS
# * Windows (disabled)
# * Windows
# * FreeBSD
#
# To skip certain builds see:
Expand All @@ -17,28 +17,28 @@
# * https://github.com/marketplace/actions/cancel-workflow-action
# * https://github.com/vmactions/freebsd-vm

on: [push, pull_request]
on:
pull_request:
push:
branches: master
release:
types: [released, prereleased]
workflow_dispatch: # allows running workflow manually from the Actions tab
name: build
jobs:
# Linux + macOS + Python 3
linux-macos-py3:
name: ${{ matrix.os }}-py3
# Linux + macOS + Windows CPython 3.6+
cp36:
name: cp36+, ${{ matrix.os }}, ${{ matrix.archs }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-10.15]
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_*'
- {os: macos-11, archs: "x86_64 universal2"}
- {os: ubuntu-20.04, archs: "x86_64 i686"}
- {os: ubuntu-20.04, archs: "aarch64"}
- {os: windows-2019, archs: "AMD64 x86"}

steps:
- name: Cancel previous runs
Expand All @@ -53,22 +53,27 @@ 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: Set up QEMU
uses: docker/setup-qemu-action@v1
if: matrix.archs == 'aarch64'

- name: Run tests
run: cibuildwheel .
uses: pypa/[email protected]
with:
config-file: "./cibuildwheel.toml"
env:
CIBW_ARCHS: ${{ matrix.archs }}

- name: Create wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse

- uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: wheelhouse/*.whl

- name: Print hashes
if: matrix.os == 'ubuntu-latest'
Expand All @@ -78,25 +83,65 @@ jobs:
mv dist/psutil*.tar.gz wheelhouse/
python scripts/internal/print_hashes.py wheelhouse/

# Linux + macOS + Python 2
linux-macos-py2:
name: ${{ matrix.os }}-py2
runs-on: ubuntu-latest
# Windows cp37+ tests
# psutil tests do not like running from a virtualenv with python>=3.7 so
# not using cibuildwheel for those. run them "manually" with this job.
windows-cp3-test:
name: windows tests ${{ matrix.python }} ${{ matrix.architecture }}
needs: cp36
runs-on: windows-2019
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- {name: Linux, python: '3.9', os: ubuntu-latest}
python: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
architecture: ["x86", "x64"]

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python }}"
architecture: "${{ matrix.architecture }}"
cache: pip
cache-dependency-path: .github/workflows/build.yml
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: wheelhouse
- name: Run tests
run: |
mkdir .tests
cd .tests
pip install $(find ../wheelhouse -name '*-cp36-abi3-${{ matrix.architecture == 'x86' && 'win32' || 'win_amd64'}}.whl')[test]
export PYTHONWARNINGS=always
export PYTHONUNBUFFERED=1
export PSUTIL_DEBUG=1
python ../psutil/tests/runner.py
python ../psutil/tests/test_memleaks.py
shell: bash

# Linux + macOS + CPython 2.7 & 3.5
linux-macos-cp27-cp35:
name: cp27/cp35, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11]
env:
CIBW_ARCHS: '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 All @@ -123,6 +168,11 @@ jobs:
name: wheels
path: wheelhouse

- uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: wheelhouse/*.whl

- name: Print hashes
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -132,7 +182,7 @@ jobs:
python scripts/internal/print_hashes.py wheelhouse/

freebsd:
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
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/
45 changes: 0 additions & 45 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,62 +24,17 @@ environment:
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python37"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python38"
PYTHON_VERSION: "3.8.x"
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python39"
PYTHON_VERSION: "3.9.x"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_ARCH: "32"

- PYTHON: "C:\\Python310"
PYTHON_VERSION: "3.10.x"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_ARCH: "32"

# 64 bits

- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python38-x64"
PYTHON_VERSION: "3.8.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python39-x64"
PYTHON_VERSION: "3.9.x"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python310-x64"
PYTHON_VERSION: "3.10.x"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON_ARCH: "64"

init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"

install:
- "powershell .ci\\appveyor\\install.ps1"
# - ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
- "%WITH_COMPILER% %PYTHON%/python.exe -m pip --version"
- "%WITH_COMPILER% %PYTHON%/python.exe -m pip install --upgrade --user setuptools pip"
- "%WITH_COMPILER% %PYTHON%/python.exe scripts/internal/winmake.py setup-dev-env"
Expand Down
28 changes: 28 additions & 0 deletions cibuildwheel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[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", "universal2"]

[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.9"

[tool.cibuildwheel.windows]
# psutil tests do not like running from a virtualenv with python>=3.7
# restrict build & tests to cp36
# cp36-abi3 wheels will need to be tested outside cibuildwheel for python>=3.7
build = "cp36-*"
test-command = [
"python {project}/psutil/tests/runner.py",
"python {project}/psutil/tests/test_memleaks.py"
]

[tool.cibuildwheel.windows.environment]
PYTHONWARNINGS = "always"
PYTHONUNBUFFERED = "1"
PSUTIL_DEBUG = "1"
Loading