Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwnvol committed Sep 19, 2023
2 parents 3042a0a + bb47eab commit 6593309
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ compile_openblas_macos_arm64_task:
build_macos_arm64_wheels_task:
name: Build MacOS arm64 wheels
alias: build_macos_arm64_wheels
only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE}
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
matrix:
Expand All @@ -47,7 +48,7 @@ build_macos_arm64_wheels_task:
- brew install p7zip
- brew install jq
- brew install python@3.10
- python3.10 -m pip install cibuildwheel==2.14.1
- python3.10 -m pip install cibuildwheel==2.15.0
download_compiled_openblas_script:
- CIRRUS_BUILD_ID=$(curl -H "Accept:application/vnd.github+json" -H "Authorization:Bearer ${REPO_TOKEN}" -H "X-GitHub-Api-Version:2022-11-28" https://api.github.com/repos/daducci/AMICO/actions/variables/CIRRUS_BUILD_ID | jq -r .value)
- curl -L -o OpenBLAS.zip https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID}/compile_openblas_macos_arm64/compiled_openblas/OpenBLAS_macos_arm64.zip
Expand All @@ -61,6 +62,7 @@ build_macos_arm64_wheels_task:

trigger_github_workflow_task:
name: Trigger GitHub workflow
only_if: ${CIRRUS_CHANGE_IN_REPO} != ${CIRRUS_LAST_GREEN_CHANGE}
depends_on: build_macos_arm64_wheels
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build wheels
run-name: Build wheels - ${{ github.sha }}
on: push
on:
push:
branches:
- 'master'
- 'release/**'
jobs:
build_windows_wheels:
strategy:
Expand All @@ -13,7 +17,7 @@ jobs:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.0.0

- name: Download compiled OpenBLAS
run: |
Expand All @@ -25,7 +29,7 @@ jobs:
python setup_site.py openblas libopenblas ${{ github.workspace }}\OpenBLAS\lib ${{ github.workspace }}\OpenBLAS\include
- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }}
uses: pypa/cibuildwheel@v2.14.1
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_PLATFORM: windows
CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }}
Expand All @@ -36,7 +40,7 @@ jobs:
delvewheel repair --add-path ${{ github.workspace }}\OpenBLAS\bin -w {dest_dir} -v {wheel}
- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: wheels_windows_${{ matrix.arch[0] }}
path: ./wheelhouse/*.whl
Expand All @@ -52,7 +56,7 @@ jobs:
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.0.0

- name: Download compiled OpenBLAS
uses: dawidd6/action-download-artifact@v2.27.0
Expand All @@ -69,7 +73,7 @@ jobs:
python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include
- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }}
uses: pypa/cibuildwheel@v2.14.1
uses: pypa/cibuildwheel@v2.15.0
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
CIBW_PLATFORM: macos
Expand All @@ -79,7 +83,7 @@ jobs:
DYLD_LIBRARY_PATH=${{ github.workspace }}/OpenBLAS/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: wheels_macos_${{ matrix.arch[0] }}
path: ./wheelhouse/*.whl
Expand All @@ -106,7 +110,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.0.0

- name: Download compiled OpenBLAS
uses: dawidd6/action-download-artifact@v2.27.0
Expand All @@ -123,12 +127,12 @@ jobs:
python setup_site.py openblas openblas /host${{ github.workspace }}/OpenBLAS/lib /host${{ github.workspace }}/OpenBLAS/include
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
uses: docker/setup-qemu-action@v3.0.0
with:
platforms: ${{ matrix.arch[2] }}

- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }}
uses: pypa/cibuildwheel@v2.14.1
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_PLATFORM: linux
CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }}
Expand All @@ -137,7 +141,7 @@ jobs:
LD_LIBRARY_PATH=/host${{ github.workspace }}/OpenBLAS/lib auditwheel repair -w {dest_dir} {wheel}
- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: wheels_linux_${{ matrix.arch[0] }}
path: ./wheelhouse/*.whl
Expand All @@ -148,7 +152,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.0.0

- name: Set up the configuration file
run: |
Expand All @@ -161,7 +165,7 @@ jobs:
python -m build --sdist
- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: sdist
path: ./dist/*.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compile_openblas_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 600 # NOTE: need this to compile the arm64 version
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
uses: docker/setup-qemu-action@v3.0.0
with:
platforms: ${{ matrix.arch[3] }}

Expand All @@ -27,7 +27,7 @@ jobs:
docker exec -i openblas_${{ matrix.arch[0] }} sh -c "make install -C /host/OpenBLAS-0.3.21 PREFIX=/host/OpenBLAS"
- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: OpenBLAS_linux_${{ matrix.arch[0] }}
path: ./OpenBLAS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compile_openblas_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
make install -C OpenBLAS-0.3.21 PREFIX=${GITHUB_WORKSPACE}/OpenBLAS
- name: Upload artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: OpenBLAS_macos_${{ matrix.arch[0] }}
path: ./OpenBLAS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_arm64_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Upload artifacts
id: upload_artifacts
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v3.1.3
with:
name: wheels_macos_arm64
path: ./wheelhouse/*.whl
Expand Down
180 changes: 180 additions & 0 deletions .github/workflows/publish_on_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
name: Publish on PyPI
run-name: Publish on PyPI - ${{ github.sha }}
on:
release:
types: [published]
jobs:
publish_on_pypi:
name: Publish on PyPI
if: github.event.release.prerelease == false
runs-on: ubuntu-20.04
environment:
name: pypi
url: https://pypi.org/project/dmri-amico
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download windows_AMD64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_windows_AMD64
path: dist
search_artifacts: true

- name: Download windows_x86 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_windows_x86
path: dist
search_artifacts: true

- name: Download macos_x86_64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_macos_x86_64
path: dist
search_artifacts: true

- name: Download macos_arm64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: macos_arm64_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_macos_arm64
path: dist
search_artifacts: true

- name: Download linux_x86_64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_linux_x86_64
path: dist
search_artifacts: true

- name: Download linux_aarch64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_linux_aarch64
path: dist
search_artifacts: true

- name: Download source distribution
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: sdist
path: dist
search_artifacts: true

- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
skip-existing: true
verbose: true
print-hash: true

publish_on_pypi_test:
name: Publish on PyPI Test
if: github.event.release.prerelease == true && contains(github.event.release.tag_name, 'rc')
runs-on: ubuntu-20.04
environment:
name: testpypi
url: https://test.pypi.org/project/dmri-amico
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download windows_AMD64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_windows_AMD64
path: dist
search_artifacts: true

- name: Download windows_x86 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_windows_x86
path: dist
search_artifacts: true

- name: Download macos_x86_64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_macos_x86_64
path: dist
search_artifacts: true

- name: Download macos_arm64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: macos_arm64_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_macos_arm64
path: dist
search_artifacts: true

- name: Download linux_x86_64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_linux_x86_64
path: dist
search_artifacts: true

- name: Download linux_aarch64 wheels
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: wheels_linux_aarch64
path: dist
search_artifacts: true

- name: Download source distribution
uses: dawidd6/action-download-artifact@v2.27.0
with:
workflow: build_wheels.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: sdist
path: dist
search_artifacts: true

- name: Publish on PyPI Test
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
repository_url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true
print-hash: true
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log
### All notable changes to `AMICO` will be documented in this file.

## `v2.0.0`<br>_2023-08-##_
## `v2.0.0`<br>_2023-09-14_
### 🛠️Changed
- From multiprocessing to `multithreading` (huge speedup in models fit! 🚀)
- `models` and `lut` modules in Cython
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[build-system]
requires = [
"setuptools>=59.6.0",
"Cython>=0.29.33",
"Cython>=3.0.2",
"spams-cython>=1.0.0"
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
before-test = "python -m pip install -U pip && pip install -U setuptools && pip install -r requirements.txt --only-binary :all:"
test-command = "pip list"
test-skip = "*-win32 cp38-macosx_arm64 *-manylinux_aarch64"
# before-test = "python -m pip install -U pip && pip install -U setuptools && pip install -r requirements.txt --only-binary :all:"
# test-command = "pip list"
# test-skip = "*-win32 cp38-macosx_arm64 *-manylinux_aarch64"
build-verbosity = 3
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ numpy>=1.19.5
scipy>=1.5.4
dipy>=1.4.1
threadpoolctl>=3.1.0
dicelib
dmri-dicelib>=1.0.0
importlib-metadata>=4.8.3; python_version<"3.8"
Loading

0 comments on commit 6593309

Please sign in to comment.