From d77a78f832875cd2f389b81d1ca9a5061cd3313d Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Wed, 15 Oct 2025 09:08:52 -0600 Subject: [PATCH 1/6] update distribution steps --- .github/workflows/python-package-conda.yml | 69 ++++++++++++---------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 81529ce..2b339b3 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -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 @@ -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 + + - 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/ From 8c8c55ee24f470c0f6037944366dcda4a6102372 Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Wed, 15 Oct 2025 09:14:09 -0600 Subject: [PATCH 2/6] try installing mkldev headers --- .github/workflows/python-package-conda.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 2b339b3..238c9fe 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -104,6 +104,9 @@ jobs: with: fetch-depth: 0 + - name: install MKL-dev headers + run: sudo apt install libmkl-dev + - name: Build sdist run: pipx run build --sdist From 5040be7fa587b78269144488e619bde9e7c0cd41 Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Wed, 15 Oct 2025 09:28:41 -0600 Subject: [PATCH 3/6] install through intel channel --- .github/workflows/python-package-conda.yml | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 238c9fe..5a27458 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -99,16 +99,34 @@ jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest + env: + ONEAPI_ROOT: /opt/intel/oneapi steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: install MKL-dev headers - run: sudo apt install libmkl-dev + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.13" + + - name: Add Intel repository + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" + sudo apt-get update + + - name: Install Intel OneAPI + run: | + sudo apt-get install intel-oneapi-mkl-devel - name: Build sdist - run: pipx run build --sdist + run: | + source ${{ env.ONEAPI_ROOT }}/setvars.sh + python -m build --sdist - uses: actions/upload-artifact@v4 with: From 6284c707c60bb561a47d5482591cb38351d65ace Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Wed, 15 Oct 2025 09:30:55 -0600 Subject: [PATCH 4/6] pipx build command --- .github/workflows/python-package-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 5a27458..d18d271 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -126,7 +126,7 @@ jobs: - name: Build sdist run: | source ${{ env.ONEAPI_ROOT }}/setvars.sh - python -m build --sdist + pipx run build --sdist - uses: actions/upload-artifact@v4 with: From ff7bdd7253f4a585020ff8590c89b1e6b70a001d Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Wed, 15 Oct 2025 09:45:12 -0600 Subject: [PATCH 5/6] add option to ignore mkl dep during source dist generation --- .github/workflows/python-package-conda.yml | 21 +-------------------- meson.options | 6 +++++- pydiso/meson.build | 6 ++++-- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index d18d271..49f8e9d 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -106,27 +106,8 @@ jobs: with: fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.13" - - - name: Add Intel repository - run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" - sudo apt-get update - - - name: Install Intel OneAPI - run: | - sudo apt-get install intel-oneapi-mkl-devel - - name: Build sdist - run: | - source ${{ env.ONEAPI_ROOT }}/setvars.sh - pipx run build --sdist + run: pipx run build --sdist -Csetup-args="-Ddist_ignore_mkl_dep=true" - uses: actions/upload-artifact@v4 with: diff --git a/meson.options b/meson.options index 6440a29..67c480a 100644 --- a/meson.options +++ b/meson.options @@ -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`') \ No newline at end of file + 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.' +) \ No newline at end of file diff --git a/pydiso/meson.build b/pydiso/meson.build index 1b2893a..1696239 100644 --- a/pydiso/meson.build +++ b/pydiso/meson.build @@ -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, @@ -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 From 5a353527fcc7a4841bc4d3d200570db63fb76803 Mon Sep 17 00:00:00 2001 From: Joseph Capriotti Date: Wed, 15 Oct 2025 09:48:13 -0600 Subject: [PATCH 6/6] remove extra env variable --- .github/workflows/python-package-conda.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 49f8e9d..a1b74ce 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -99,8 +99,6 @@ jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest - env: - ONEAPI_ROOT: /opt/intel/oneapi steps: - uses: actions/checkout@v5 with: