Skip to content

1.8.1

1.8.1 #52

Workflow file for this run

name: Build and Publish
on:
release:
types: [published]
jobs:
tests:
name: Run tests
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest, macos-14, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Configure OpenMP (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libgomp1
echo "CC=gcc" >> $GITHUB_ENV
echo "CFLAGS=-fopenmp" >> $GITHUB_ENV
echo "LDFLAGS=-fopenmp" >> $GITHUB_ENV
- name: Install OpenMP and CVXOPT dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install libomp suite-sparse openblas
LIBOMP_PREFIX=$(brew --prefix libomp)
SUITESPARSE_PREFIX=$(brew --prefix suite-sparse)
OPENBLAS_PREFIX=$(brew --prefix openblas)
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
echo "CFLAGS=-Xpreprocessor -fopenmp -I${LIBOMP_PREFIX}/include" >> $GITHUB_ENV
echo "LDFLAGS=-L${LIBOMP_PREFIX}/lib -lomp -Wl,-rpath,${LIBOMP_PREFIX}/lib" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${LIBOMP_PREFIX}/lib" >> $GITHUB_ENV
echo "CVXOPT_SUITESPARSE_INC_DIR=${SUITESPARSE_PREFIX}/include" >> $GITHUB_ENV
echo "CVXOPT_SUITESPARSE_LIB_DIR=${SUITESPARSE_PREFIX}/lib" >> $GITHUB_ENV
echo "CVXOPT_BLAS_LIB_DIR=${OPENBLAS_PREFIX}/lib" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
uses: GabrielBB/xvfb-action@v1
with:
run: python -m tox
env:
PLATFORM: ${{ matrix.platform }}
build_wheels:
name: Build wheels on ${{ matrix.os }}
needs: tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Export Clean Version
shell: bash
run: |
CLEAN_VERSION="${GITHUB_REF_NAME#v}"
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
echo "Versión forzada a: $CLEAN_VERSION"
- name: Install OpenMP (macOS)
if: runner.os == 'macOS'
run: brew install libomp
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.SETUPTOOLS_SCM_PRETEND_VERSION }}
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-*
CIBW_SKIP: "pp* *musllinux* *i686*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=14.0
CC=/usr/bin/clang
CFLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include"
LDFLAGS="-L$(brew --prefix libomp)/lib -lomp -Wl,-rpath,$(brew --prefix libomp)/lib"
SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.SETUPTOOLS_SCM_PRETEND_VERSION }}
CIBW_ENVIRONMENT_LINUX: >
CFLAGS="-fopenmp"
LDFLAGS="-fopenmp"
SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.SETUPTOOLS_SCM_PRETEND_VERSION }}
CIBW_ENVIRONMENT_WINDOWS: >
SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.SETUPTOOLS_SCM_PRETEND_VERSION }}
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Export Clean Version
run: |
CLEAN_VERSION="${GITHUB_REF_NAME#v}"
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
- name: Build sdist
run: pipx run build --sdist
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.SETUPTOOLS_SCM_PRETEND_VERSION }}
- uses: actions/upload-artifact@v4
with:
name: manual-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: manual-sdist
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}