Skip to content

Commit

Permalink
BLD: Update cibuildwheel setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Oct 2, 2023
1 parent b81cfae commit 0c1cb78
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/ci-test-xtgeo-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
name: CIBW python ${{ matrix.cibw_python }} on ${{ matrix.os.runs_on }}
runs-on: ${{ matrix.os.runs_on }}
strategy:
fail-fast: false
matrix:
cibw_python: [cp38, cp39, cp310, cp311]
os:
Expand All @@ -22,32 +23,21 @@ jobs:
cibw_image: macosx_x86_64

env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# pillow < 8.4 required for CIBW build
CIBW_BEFORE_TEST: >
pushd {project} &&
pip install -r requirements/requirements_test.txt &&
git clone --depth 1 https://github.com/equinor/xtgeo-testdata ../xtgeo-testdata
# Ignore forking tests as they do not work well with CIBW
CIBW_TEST_COMMAND: >
pushd {project} &&
pytest --disable-warnings -x -m "not hypothesis" --ignore tests/test_well --ignore-glob="*forks.py"
CIBW_BUILD: ${{ matrix.cibw_python }}-${{ matrix.os.cibw_image }}
# CIBW_TEST_SKIP: "cp312*linux* cp312*macos*"
CIBW_BEFORE_BUILD: python -m pip install "pip<=22.0.4"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2

- name: Install cibuildwheel
run: >
python -m pip install wheel &&
python -m pip install cibuildwheel
run: pip install wheel cibuildwheel

- name: Run cibuildwheel
run: python -m cibuildwheel --output-dir wheelhouse

- name: Publish
if: ${{ github.event_name == 'release' }}
env:
Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ exclude = '''
)/
'''

[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
test-extras = ["dev"]
before-build = 'python -m pip install "pip<=22.0.4"'
before-test = [
"pushd {package}",
"git clone --depth 1 https://github.com/equinor/xtgeo-testdata ../xtgeo-testdata",
]
test-command = [
"pushd {package}",
# Ignore forking tests as they do not work well with CIBW
"pytest --disable-warnings -x -m 'not hypothesis' --ignore tests/test_well --ignore-glob='*forks.py'",
]

[tool.isort]
profile = "black"

Expand Down

0 comments on commit 0c1cb78

Please sign in to comment.