Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 37 additions & 32 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.13"

- name: Create Conda environment file
run: |
python -m pip install pyyaml
Expand Down Expand Up @@ -96,45 +96,50 @@ jobs:
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # required

distribute:
name: Distributing from 3.11
needs: build-and-test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Build sdist
run: pipx run build --sdist -Csetup-args="-Ddist_ignore_mkl_dep=true"

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

release:
needs: [
build_sdist
]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
- uses: actions/download-artifact@v4
with:
python-version: "3.11"
channels: defaults
channel-priority: true
activate-environment: dev
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- name: Install Env
run: |
conda info
conda list
conda config --show

- name: Create environment
run: |
conda install --quiet --yes -c conda-forge \
pip numpy scipy cython mkl=2023 \
mkl-devel pkg-config meson-python meson ninja setuptools_scm \
python-build

- name: Generate Source Distribution
run: |
python -m build --no-isolation --skip-dependency-check --sdist .
- name: Release to github
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
prerelease: false

- name: pypi-publish
uses: pypa/gh-action-pypi-publish@v1.4.2
- name: Upload wheels to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
skip-existing: true
packages-dir: ./dist/
6 changes: 5 additions & 1 deletion meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ option('use-ilp64', type: 'boolean', value: false,
description: 'Use ILP64 (64-bit integer) BLAS and LAPACK interfaces')

option('mkl-threading', type: 'string', value: 'auto',
description: 'MKL threading method, one of: `seq`, `iomp`, `gomp`, `tbb`')
description: 'MKL threading method, one of: `seq`, `iomp`, `gomp`, `tbb`')

option('dist_ignore_mkl_dep', type: 'boolean', value: false,
description: 'Mark the mkl dep as optional, for use during source distribution archiving.'
)
6 changes: 4 additions & 2 deletions pydiso/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ mkl_version_req = '>=2023.0'

use_sdl = get_option('use-sdl')

mkl_required = not get_option('dist_ignore_mkl_dep')

if use_sdl
mkl_dep = dependency('mkl-sdl', required: true)
mkl_dep = dependency('mkl-sdl', required: mkl_required)
else
# find mkl
mkl_dep = dependency(mkl_dep_name,
Expand All @@ -55,7 +57,7 @@ else
# or missing it because no pkg-config installed. If so, we need to retry
# with MKL SDL, and drop the version constraint.
if not mkl_dep.found() and mkl_may_use_sdl
mkl_dep = dependency('mkl-sdl', required: true)
mkl_dep = dependency('mkl-sdl', required: mkl_required)
endif

endif
Expand Down
Loading