Skip to content

Commit

Permalink
resurrect release-1.15 CI
Browse files Browse the repository at this point in the history
* backport various changes from release-1.16 for GHA, new minimum MacOS runner versions
* CI/test updates only
  • Loading branch information
nitzmahone committed Sep 25, 2023
1 parent 12ca567 commit e94b119
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 11 deletions.
41 changes: 30 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
on: push
on:
push:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
sdist:
runs-on: ubuntu-20.04
steps:
- name: clone repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: build sdist
run: |
Expand All @@ -14,14 +17,15 @@ jobs:
python -m build --sdist
- name: upload sdist artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: dist
if-no-files-found: error

linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- spec: cp27-manylinux_x86_64
Expand Down Expand Up @@ -70,7 +74,7 @@ jobs:
test_args: '{project}/c'
steps:
- name: clone repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: configure docker foreign arch support
uses: docker/setup-qemu-action@v1
Expand Down Expand Up @@ -104,7 +108,7 @@ jobs:
- name: upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: dist
if-no-files-found: error
Expand All @@ -114,8 +118,9 @@ jobs:
defaults:
run:
shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }}
runs-on: ${{ matrix.runs_on || 'macos-10.15' }}
runs-on: ${{ matrix.runs_on || 'macos-11' }}
strategy:
fail-fast: false
matrix:
include:
# build for x86_64 under the default hosted macOS 10.x x86_64 runner
Expand All @@ -131,31 +136,42 @@ jobs:
# FIXME: ? cp38-macosx_arm64 requires special handling and fails some test_zdist tests under cibw 2.1.2, skip it (so Apple's XCode python3 won't have a wheel)
- spec: cp39-macosx_arm64
deployment_target: '11.0'
runs_on: [self-hosted, macOS]
runs_on:
- ${{ vars.run_macos_arm64_jobs == 'true' && 'self-hosted' || 'ubuntu-latest' }}
- ${{ vars.run_macos_arm64_jobs == 'true' && 'macOS' || 'ubuntu-latest' }}
maybe_skip: ${{ vars.run_macos_arm64_jobs != 'true' && 'skip' }}
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
sdkroot: macosx11.3

- spec: cp310-macosx_arm64
deployment_target: '11.0'
runs_on: [self-hosted, macOS]
runs_on:
- ${{ vars.run_macos_arm64_jobs == 'true' && 'self-hosted' || 'ubuntu-latest' }}
- ${{ vars.run_macos_arm64_jobs == 'true' && 'macOS' || 'ubuntu-latest' }}
maybe_skip: ${{ vars.run_macos_arm64_jobs != 'true' && 'skip' }}
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
sdkroot: macosx11.3

- spec: cp311-macosx_arm64
deployment_target: '11.0'
runs_on: [self-hosted, macOS]
runs_on:
- ${{ vars.run_macos_arm64_jobs == 'true' && 'self-hosted' || 'ubuntu-latest' }}
- ${{ vars.run_macos_arm64_jobs == 'true' && 'macOS' || 'ubuntu-latest' }}
maybe_skip: ${{ vars.run_macos_arm64_jobs != 'true' && 'skip' }}
run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
sdkroot: macosx11.3


steps:
- name: clone repo
uses: actions/checkout@v2
if: ${{ matrix.maybe_skip != 'skip' }}

- name: build wheel prereqs
run: |
/usr/bin/pip3 install --user --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}"
brew uninstall --ignore-dependencies libffi || true
if: ${{ matrix.maybe_skip != 'skip' }}

- name: build/test wheels
env:
Expand All @@ -175,16 +191,19 @@ jobs:
fi
/usr/bin/python3 -m cibuildwheel --output-dir dist
if: ${{ matrix.maybe_skip != 'skip' }}

- name: upload artifacts
uses: actions/upload-artifact@v2
with:
path: dist
if-no-files-found: error
if: ${{ matrix.maybe_skip != 'skip' }}

windows:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
include:
- spec: cp27-win_amd64
Expand All @@ -205,7 +224,7 @@ jobs:
- spec: cp311-win32
steps:
- name: clone repo
uses: actions/checkout@v2
uses: actions/checkout@v4

# HACK: MS killed this SDK support package and removed downloads, as did chocolatey, install from a private archive
- name: install Windows Python 2.7 SDK
Expand Down Expand Up @@ -234,7 +253,7 @@ jobs:
shell: bash

- name: upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: dist
if-no-files-found: error
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/
/dist/
*.py[cod]
__pycache__/
*.egg-info/
*.so
2 changes: 2 additions & 0 deletions c/test_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def find_and_load_library(name, flags=RTLD_NOW):
path = None
else:
path = ctypes.util.find_library(name)
if path is None and sys.platform == 'darwin' and sys.version_info[:2] == (3, 8):
pytest.xfail("find_library usually broken on MacOS Python 3.8")
if path is None and name == 'c':
assert sys.platform == 'win32'
assert (sys.version_info >= (3,) or
Expand Down
5 changes: 5 additions & 0 deletions testing/cffi0/test_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from testing.support import *
from testing.support import extra_compile_args, is_musl

# eliminate warning noise from common test modules that are repeatedly re-imported
pytestmark = [
pytest.mark.filterwarnings("ignore:reimporting:UserWarning"),
#pytest.mark.filterwarnings("ignore:Deprecated:_DeprecatedConfig")
]

lib_m = ['m']
if sys.platform == 'win32':
Expand Down
4 changes: 4 additions & 0 deletions testing/cffi0/test_verify2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import pytest
from .test_verify import *

# eliminate warning noise from common test modules that are repeatedly re-imported
pytestmark = pytest.mark.filterwarnings("ignore:reimporting:UserWarning")

# This test file runs normally after test_verify. We only clean up the .c
# sources, to check that it also works when we have only the .so. The
# tests should run much faster than test_verify.
Expand Down
19 changes: 19 additions & 0 deletions testing/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest
import sys

from ctypes import util

# this problem was supposedly fixed in a newer Python 3.8 release, but after binary installer support expired
# https://github.com/python/cpython/pull/28054
if sys.platform == 'darwin' and sys.version_info[:2] == (3, 8):
orig_find_library = util.find_library

def hacked_find_library(*args, **kwargs):
res = orig_find_library(*args, **kwargs)

if res is None:
pytest.xfail("busted find_library on MacOS Python 3.8")

return res

util.find_library = hacked_find_library

0 comments on commit e94b119

Please sign in to comment.