fix macos python 3.11 #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Build wheels and Deploy | |
# Build on every branch push, tag push, and pull request change: | |
on: [push, pull_request] | |
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | |
# on: | |
# push: | |
# pull_request: | |
# release: | |
# types: | |
# - published | |
jobs: | |
test_code: | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./python | |
strategy: | |
matrix: | |
python-version: [ '3.9', '3.11', '3.12' ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: copy data to root (unix-like) | |
run: cp ../readme.md . | |
working-directory: ${{env.working-directory}} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --force-reinstall ninja | |
python -m pip install flake8 pytest meson meson-python charset-normalizer setuptools | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
working-directory: ${{env.working-directory}} | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
working-directory: ${{env.working-directory}} | |
- name: Build c extensions | |
run: | | |
# python setup.py build_ext --inplace | |
python setup.py install | |
# pip install . | |
working-directory: ${{env.working-directory}} | |
- name: Test with pytest | |
run: | | |
# pytest test | |
python -m site | |
pip list | |
cd unittest | |
pytest | |
working-directory: ${{env.working-directory}} | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
working-directory: ./python | |
needs: [ test_code ] | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/migration_meson' | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-13] | |
# os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v3 | |
- name: copy data to root (unix-like) | |
run: | | |
ls -la | |
cp -r ${{env.working-directory}}/* . | |
continue-on-error: true | |
- uses: suisei-cn/actions-download-file@v1 | |
id: downloadfile1 | |
name: Download lapack for win | |
with: | |
# url: "https://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/libblas.lib" | |
url: "https://github.com/abelcarreras/abelcarreras.github.io/raw/master/libraries/windows/libblas.lib" | |
continue-on-error: true | |
- uses: suisei-cn/actions-download-file@v1 | |
id: downloadfile2 | |
name: Download blas for win | |
with: | |
# url: "https://icl.cs.utk.edu/lapack-for-windows/libraries/VisualStudio/3.7.0/Dynamic-MINGW/Win64/liblapack.lib" | |
url: "https://github.com/abelcarreras/abelcarreras.github.io/raw/master/libraries/windows/liblapack.lib" | |
continue-on-error: true | |
- name: copy data to root (windows) | |
run: | | |
xcopy .\python\* . /E /C /H /R /K /O /Y | |
continue-on-error: true | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.17.0 | |
#run: python -m pip install cibuildwheel==2.21.3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --force-reinstall ninja | |
python -m pip install flake8 numpy pytest meson meson-python charset-normalizer setuptools | |
#if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BEFORE_BUILD: pip install numpy meson meson-python charset-normalizer setuptools ninja | |
CIBW_BUILD: cp310-* cp311-* cp312-* | |
CIBW_ARCHS_MACOS: x86_64 | |
CIBW_BEFORE_ALL_MACOS: | | |
brew reinstall gcc | |
python -m pip install --force-reinstall ninja | |
CIBW_BEFORE_ALL_LINUX: | | |
#sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* | |
#sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* | |
#yum install -y lapack-devel blas-devel | |
#yum info lapack | |
#find /usr/ -name "*lapack*.so" -o -name "*blas*.so" | |
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/ | |
#apt-get install -y libblas-dev liblapack-dev | |
#apk add openblas-dev; apk add lapack-dev | |
#echo "import platform; print(platform.platform())" | python | |
#cp /usr/lib64/liblapack.so . | |
#cp /usr/lib64/libblas.so . | |
python -m pip install --force-reinstall ninja | |
CIBW_BEFORE_BUILD_WINDOWS: | | |
echo $MINGW_PREFIX | |
python -m pip install --force-reinstall ninja | |
copy libblas.lib C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\libblas.a | |
copy liblapack.lib C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\liblapack.a | |
# copy setup_win.cfg setup.cfg | |
CIBW_SKIP: "*-musllinux_* *win32*" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
needs: [ test_code ] | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ./python | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/migration_meson' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: copy data to root (unix-like) | |
run: | | |
cp -r ${{env.working-directory}}/* . | |
continue-on-error: true | |
- name: Install dependencies | |
run: | | |
python -m pip install numpy setuptools | |
- name: Build sdist | |
run: | | |
python setup.py sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist, test_code] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
# upload to PyPI on every tag starting with 'v' | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true |