diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 81529ce..a1b74ce 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 -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/ 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