-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf6cf91
commit 1575ac4
Showing
4 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Build quaddtype wheels and release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Set up Conda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: '3.10' | ||
channels: conda-forge,defaults | ||
channel-priority: strict | ||
|
||
- name: Install SLEEF and other dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda install -y sleef numpy meson meson-python patchelf wheel | ||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==2.11.2 | ||
|
||
- name: Build wheels | ||
shell: bash -l {0} | ||
run: | | ||
export LIBRARY_PATH=$CONDA_PREFIX/lib:$LIBRARY_PATH | ||
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH | ||
export CPATH=$CONDA_PREFIX/include:$CPATH | ||
python -m cibuildwheel --output-dir wheelhouse | ||
env: | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | ||
CIBW_BUILD_VERBOSITY: "1" | ||
CIBW_ENVIRONMENT: > | ||
LIBRARY_PATH=$CONDA_PREFIX/lib:$LIBRARY_PATH | ||
LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH | ||
CPATH=$CONDA_PREFIX/include:$CPATH | ||
working-directory: ./quaddtype | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./quaddtype/wheelhouse/*.whl | ||
name: wheels | ||
|
||
create_release: | ||
name: Create Release | ||
needs: build_wheels | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download all workflow run artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: artifacts | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./artifacts/wheels/*.whl | ||
asset_name: quaddtype-${{ github.ref_name }}.whl | ||
asset_content_type: application/zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,4 +133,5 @@ compile_commands.json | |
|
||
.ruff-cache/ | ||
.asv | ||
.vscode/ | ||
.vscode/ | ||
*.whl |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ name = "quaddtype" | |
description = "Quad (128-bit) float dtype for numpy" | ||
version = "0.0.1" | ||
readme = 'README.md' | ||
author = "Swayam Singh" | ||
authors = [{name = "Swayam Singh", email = "[email protected]"}] | ||
requires-python = ">=3.9.0" | ||
dependencies = [ | ||
"numpy" | ||
|
@@ -23,3 +23,40 @@ dependencies = [ | |
test = [ | ||
"pytest", | ||
] | ||
|
||
[tool.cibuildwheel] | ||
archs = ["auto64"] | ||
skip = ["*-musllinux*", "pp*", "cp36-*", "cp37-*", "cp38-*"] | ||
environment = { PATH = "$PATH:/usr/share/miniconda3/bin" } | ||
|
||
[tool.cibuildwheel.linux] | ||
before-all = """ | ||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p /usr/share/miniconda3 | ||
export PATH="/usr/share/miniconda3/bin:$PATH" | ||
conda config --add channels conda-forge | ||
conda config --set channel_priority strict | ||
conda install -y sleef | ||
""" | ||
|
||
[tool.cibuildwheel.macos] | ||
before-all = """ | ||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p $HOME/miniconda3 | ||
export PATH="$HOME/miniconda3/bin:$PATH" | ||
conda config --add channels conda-forge | ||
conda config --set channel_priority strict | ||
conda install -y sleef | ||
""" | ||
|
||
[tool.cibuildwheel.windows] | ||
before-all = """ | ||
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe', 'miniconda.exe')" | ||
start /wait "" miniconda.exe /S /D=C:\\Miniconda3 | ||
set PATH=C:\\Miniconda3;C:\\Miniconda3\\Scripts;%PATH% | ||
conda config --add channels conda-forge | ||
conda config --set channel_priority strict | ||
conda install -y sleef | ||
""" | ||
before-build = "pip install delvewheel" | ||
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}" |