diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d0923ae7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +--- +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build wheels + uses: pypa/cibuildwheel@v1.11.1 + env: + CIBW_SKIP: "cp27-* cp34-* cp35-* pp*" + CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" + CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" + CIBW_TEST_COMMAND: "pytest {project}/test" + CIBW_TEST_REQUIRES: pytest + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + build_wheels_windows: + name: Build wheels on windows Python-${{ matrix.python-version }} ${{ matrix.arch }} + runs-on: windows-latest + strategy: + matrix: + arch: [x64] #, x86] + python-version: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: conda-incubator/setup-miniconda@v2 + if: matrix.arch == 'x64' + with: + activate-environment: scs + auto-update-conda: true + channels: conda-forge,anaconda + python-version: ${{ matrix.python-version }} + miniconda-version: "latest" + - uses: conda-incubator/setup-miniconda@v2 + if: matrix.arch == 'x86' + with: + activate-environment: scs + miniconda-version: "4.5.12" + auto-update-conda: true + channels: conda-forge,ana + python-version: ${{ matrix.python-version }} + architecture: x86 + - name: Install Deps + run: conda install numpy scipy nose mkl openblas lapack + - name: Build Wheel + run: python setup.py bdist_wheel + - name: Repair Wheel + shell: bash -l {0} + run: | + set -e + pip install delvewheel + delvewheel repair dist/*whl + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.arch }} + - name: Run tests + shell: bash + run: | + set -e + which python + pip install wheelhouse/*whl + pip install pytest + pytest + - uses: actions/upload-artifact@v2 + with: + path: ./dist/*.whl diff --git a/pyproject.toml b/pyproject.toml index fd16e7b7..3a567e98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,7 @@ [build-system] requires = [ - "numpy>=1.17,<1.18; python_version=='3.5'", - "numpy>=1.17,<1.18; python_version=='3.6'", - "numpy>=1.17,<1.18; python_version=='3.7'", - "numpy>=1.17,<1.18; python_version=='3.8'", - "numpy>=1.19,<1.20; python_version=='3.9'", - "setuptools", - "wheel", + "setuptools", + "wheel", + "oldest-supported-numpy", ] +build-backend = "setuptools.build_meta"