Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
2483d8f
test, deactivated workflow
enzbus Oct 27, 2024
eba8a44
test, copied cibuildwheel from website
enzbus Oct 27, 2024
5119046
test
enzbus Oct 27, 2024
1c864bb
test
enzbus Oct 27, 2024
6d127e7
test
enzbus Oct 27, 2024
8eeffa2
test
enzbus Oct 27, 2024
0147523
pytest
enzbus Oct 27, 2024
7f1d288
test
enzbus Oct 27, 2024
5a0ef44
linux install blas
enzbus Oct 27, 2024
b204c61
test
enzbus Oct 27, 2024
c82ee46
test
enzbus Oct 27, 2024
197d2ab
test
enzbus Oct 27, 2024
14bb50e
test
enzbus Oct 27, 2024
4766ac5
typo
enzbus Oct 27, 2024
e5743d3
test
enzbus Oct 27, 2024
80308a1
test
enzbus Oct 27, 2024
97cb4ef
test, search on linux archs
enzbus Oct 27, 2024
c77d1a6
test, search on linux archs
enzbus Oct 27, 2024
351f1d3
test, search on linux archs
enzbus Oct 27, 2024
01aeeb8
test, search on linux archs
enzbus Oct 27, 2024
8ea5c40
was missing qemu setup in GH runner
enzbus Oct 27, 2024
2d103cd
wrong override param from the yaml
enzbus Oct 27, 2024
3a23a6c
aarch64
enzbus Oct 27, 2024
adbd43d
maybe was missing lapack
enzbus Oct 27, 2024
543c637
test using miniconda, can always revert
enzbus Oct 27, 2024
c9e90ba
wget curl
enzbus Oct 27, 2024
ad5861e
wget
enzbus Oct 27, 2024
ccec7ae
retry
enzbus Oct 27, 2024
a295169
retry, conda more problems
enzbus Oct 27, 2024
b7df98f
retry musllinux
enzbus Oct 27, 2024
085ad22
trying windows build
enzbus Oct 27, 2024
0c2c93d
trying windows build
enzbus Oct 27, 2024
1d4694d
trying windows build
enzbus Oct 27, 2024
26e6d9a
trying windows build
enzbus Oct 27, 2024
6050434
trying windows build
enzbus Oct 27, 2024
9a0b4c5
trying windows build
enzbus Oct 27, 2024
e0494b1
trying windows build, openblas via conda
enzbus Oct 27, 2024
3dc6474
trying windows build, openblas and python via conda
enzbus Oct 27, 2024
af6a783
typos
enzbus Oct 27, 2024
4ad2415
typos
enzbus Oct 27, 2024
7c1ea1d
windows
enzbus Oct 27, 2024
1bdf1fa
windows
enzbus Oct 27, 2024
56288cb
windows
enzbus Oct 27, 2024
22e4407
windows
enzbus Oct 27, 2024
f56de2d
re-enabled all that work so far
enzbus Oct 27, 2024
afe060d
disabled some musllinuxes
enzbus Oct 27, 2024
414b639
disabled some musllinuxes
enzbus Oct 27, 2024
57896f0
testing pypi
enzbus Oct 27, 2024
fefbf86
typo
enzbus Oct 27, 2024
b3ddce6
syntax yaml errors
enzbus Oct 27, 2024
835e9a8
Update cibuildwheel.yml
enzbus Oct 27, 2024
5906a08
syntax yaml errors
enzbus Oct 27, 2024
91dcec0
get aarch64 linux to work
enzbus Oct 27, 2024
6a81a00
get aarch64 linux to work
enzbus Oct 27, 2024
c15e54a
get aarch64 linux to work
enzbus Oct 27, 2024
66efe09
get aarch64 linux to work
enzbus Oct 27, 2024
10351a3
get aarch64 linux to work
enzbus Oct 27, 2024
150e5b6
get aarch64 linux to work
enzbus Oct 27, 2024
1050532
get aarch64 linux to work
enzbus Oct 27, 2024
c1b666b
get aarch64 linux to work
enzbus Oct 27, 2024
1a44c6c
get aarch64 linux to work
enzbus Oct 27, 2024
9a71316
get aarch64 linux to work
enzbus Oct 27, 2024
ea4008b
get aarch64 linux to work
enzbus Oct 27, 2024
bc3dd93
aarch64 linux works! now cleaning and then merging
enzbus Oct 27, 2024
4f68387
figuring which musllinux work
enzbus Oct 27, 2024
b990ce8
cleaning up, about to reopen MR
enzbus Oct 27, 2024
f4c1b7a
renaming
enzbus Oct 27, 2024
c3a7c00
typo
enzbus Oct 27, 2024
5babd8f
typo
enzbus Oct 27, 2024
cc7d6f3
renamed to original file, merged
enzbus Oct 27, 2024
053f7b2
disabled win py3.8 mkl test
enzbus Oct 27, 2024
29aafd2
added macros to scspy C code
enzbus Nov 16, 2024
44daaed
broke something with PyTypeObject
enzbus Nov 16, 2024
c1ebc02
trying 3.7
enzbus Nov 16, 2024
27fb7b1
trying 3.8
enzbus Nov 16, 2024
a19593d
trying 3.9
enzbus Nov 16, 2024
aa94da8
from docs it appears pytypeobject was added to ABI3 in 3.10
enzbus Nov 16, 2024
f4c33e2
trying 3.11
enzbus Nov 16, 2024
be9b32d
Revert "trying 3.11"
enzbus Nov 16, 2024
7737439
Revert "from docs it appears pytypeobject was added to ABI3 in 3.10"
enzbus Nov 16, 2024
f236f62
Revert "trying 3.9"
enzbus Nov 16, 2024
742b532
Revert "trying 3.8"
enzbus Nov 16, 2024
07ba527
Revert "trying 3.7"
enzbus Nov 16, 2024
01f97de
Revert "broke something with PyTypeObject"
enzbus Nov 16, 2024
aa7e927
Revert "added macros to scspy C code"
enzbus Nov 16, 2024
f7143a6
cleaned pyproj; put back logic to upload on push new tag
enzbus Nov 16, 2024
4a5eb3e
further cleaning build.yaml; no need for secrets envs
enzbus Nov 16, 2024
b99354f
Merge branch 'master' into master
bodono Nov 21, 2024
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
152 changes: 60 additions & 92 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ on:
- '*'

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

build_openmp:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -50,7 +43,7 @@ jobs:
pytest
rm -rf build/

build:
build_mkl:
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -62,7 +55,7 @@ jobs:
# runners have Apple silicon chips.
os: [ ubuntu-latest, macos-13, windows-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13"]
link_mkl: [true, false]
link_mkl: [true]

env:
PYTHON_VERSION: ${{ matrix.python-version }}
Expand All @@ -76,7 +69,6 @@ jobs:
- name: Set Additional Envs
shell: bash
run: |
echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
- uses: conda-incubator/setup-miniconda@v3
with:
Expand Down Expand Up @@ -112,110 +104,86 @@ jobs:
run: |
pytest
rm -rf build/
- name: Build and test windows wheels
if: ${{startsWith(matrix.os, 'windows') && !matrix.link_mkl}}
run: |
python -m pip install build
python -m build -Csetup-args="-Dlink_blas_statically=True"
python -m pip install delvewheel
delvewheel repair dist/*whl
conda remove openblas # to check static linkage
pip install wheelhouse/*whl --force-reinstall
pytest
- name: Upload artifacts to github
if: ${{ startsWith(matrix.os, 'windows') }}
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-3-${{ env.PYTHON_SUBVERSION }}
path: ./wheelhouse

# from here to end it's a copy-paste, with few changes, of
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml

build_wheels:
needs: build

name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, macos-latest ]
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13"]

env:
RUNNER_OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, macos-14, windows-latest, macos-13]

steps:

- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
submodules: true

- name: Set up QEMU for aarch64 compilation on Linux
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set Additional Envs
shell: bash
run: |
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
platforms: all

- name: Install conda on Windows
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
channels: conda-forge, anaconda

- name: Install openblas from conda on Windows
if: runner.os == 'Windows'
run: conda install -y openblas pkgconfig

- name: Build wheels
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
CIBW_BEFORE_ALL_LINUX: yum install -y openblas-devel
CIBW_ENVIRONMENT_MACOS: CFLAGS='-Wno-error=implicit-function-declaration'
CIBW_BUILD_VERBOSITY: 3
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}
uses: joerick/cibuildwheel@v2.21.3

- name: Upload artifacts to github
uses: actions/upload-artifact@v4
uses: pypa/cibuildwheel@v2.21.3

- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-3-${{ env.PYTHON_SUBVERSION }}
path: ./wheelhouse
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

merge_wheels:
name: Merge wheel artifacts
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Merge wheels
uses: actions/upload-artifact/merge@v4
- uses: actions/checkout@v4
with:
name: wheels
pattern: wheels-*
delete-merged: true
submodules: true

upload_wheels:
needs: merge_wheels
runs-on: ubuntu-latest
- name: Build sdist
run: pipx run build --sdist

env:
PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
# We can also upload always, with skip-existing: true, below
# We upload on every push event (only master, above) that is a new tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# Only run this step on GH release
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Set Additional Envs
shell: bash
run: |
echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
if: ${{env.DEPLOY == 'True'}}
with:
name: wheels
path: ./wheelhouse
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- name: Release to pypi
if: ${{env.DEPLOY == 'True'}}
shell: bash
run: |
python -m pip install --upgrade twine
twine check wheelhouse/*
twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
# To test:
# with:
# repository-url: https://test.pypi.org/legacy/
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,64 @@ dependencies = [
'numpy',
'scipy',
]

[tool.cibuildwheel]
# Load SCS source submodule, already done in CI/CD
before-all = "git submodule update --init"
skip = [
"pp*", # Disable building PyPy wheels on all platforms
"*-win32", # fails on locating Python headers, probably meson.build is misconfigured
"cp37*musllinux*", # doesn't install, Scipy seems to be broken
"cp38*musllinux*", # doesn't install, Scipy seems to be broken
"*musllinux*aarch64*" # no Scipy wheels for this
]
# Test
test-requires = "pytest"
test-command = [
"echo wheel installed successfully",
"pytest {package}/test",
]
# we use the newer image for aarch64, for this there are openblas dev libraries
manylinux-aarch64-image = "manylinux_2_28"

[tool.cibuildwheel.linux]
archs = [
"x86_64",
"aarch64",
# "i686", # various issues, may work with some more testing
# "s390x", # haven't tried it
# "ppc64le", # haven't tried it
# "armv7l", # haven't tried it
]

[tool.cibuildwheel.windows]
# This will probably become default in newer cibuildwheels versions
repair-wheel-command = [
"pip install delvewheel",
"delvewheel repair -w {dest_dir} {wheel}"
]

# Openblas installation for 3 different linux images

[[tool.cibuildwheel.overrides]]
select = "*-manylinux_x86_64"
inherit.before-all = "append"
before-all = [
# "yum check-update", "yum search blas",
# netlib blas/lapack fallback compiles and tests (on aarch64) but is super slow
# "((yum install -y openblas-devel) || (yum install -y blas-devel lapack-devel))",
"yum install -y openblas-devel"]

[[tool.cibuildwheel.overrides]]
select = "*-manylinux_aarch64"
inherit.before-all = "append"
before-all = [
# "dnf update", "dnf search blas",
"dnf install -y openblas-devel"]

[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
inherit.before-all = "append"
before-all = [
# "apk update", "apk search -v '*blas*'",
"apk add openblas-dev"]