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
6 changes: 4 additions & 2 deletions .github/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
CI/CD workflows, automation, security scanning, and package distribution.

## Workflows
All build/test workflows cover Python 3.10-3.15 plus free-threaded 3.14t and 3.15t.
All build/test workflows cover Python 3.10-3.15 plus free-threaded 3.14t and 3.15t, except `conda-package-cf.yml`, which takes the versions below 3.14 from the feedstock (its `python-versions` input).

- **conda-package.yml** — main build/test pipeline (Linux/Windows)
- **conda-package-cf.yml** — build/test using only conda-forge channel (Linux/Windows)
- **conda-package-cf.yml** — build/test using only conda-forge channel (Linux/Windows/macOS), set up like `conda-forge/mkl-service-feedstock`: Windows uses `windows-2022` (Visual Studio 2022)
- **build-with-clang.yml** — Linux Clang compiler compatibility validation
- **build-with-standard-clang.yml** — standard Clang compiler compatibility validation
- **build_pip.yml** — validates editable build
Expand All @@ -22,6 +22,8 @@ All build/test workflows cover Python 3.10-3.15 plus free-threaded 3.14t and 3.1
- `include` rows create new matrix combinations and inherit nothing, so `experimental` must be repeated wherever the job reads them
- Artifact naming: `$PACKAGE_NAME $OS Python $VERSION`, where `$VERSION` is `python_tag` (`3.14`, `3.14t`, `3.15`, or `3.15t`) when set, otherwise `python`
- Channels: `conda-forge`, Intel channel
- Build jobs run `conda build --no-test`; test jobs run `conda build --test` on the built package on a fresh runner, so CI runs the test section of the recipe, as the feedstock does
- `conda-package-cf.yml` and `conda-recipe-cf/` follow `conda-forge/mkl-service-feedstock`. The feedstock's pins are kept only in `conda-recipe-cf/conda_build_config.yaml` (compiler versions, `mkl_devel`) and in the `python-versions` input of `conda-package-cf.yml` (Python versions below 3.14): when the feedstock is re-rendered with new pins, update them there, and don't restate the numbers in the `AGENTS.md` files

## Security
- OpenSSF Scorecard runs automatically
Expand Down
69 changes: 22 additions & 47 deletions .github/workflows/conda-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ on:
required: false
default: false
type: boolean
python-versions:
description: JSON list of Python versions to build and test in addition to 3.14 and 3.15, which always get both the GIL and free-threaded builds
required: false
default: '["3.10", "3.11", "3.12", "3.13"]'
type: string

permissions:
contents: read

env:
module-name: mkl
package-name: mkl-service
ver-json-path: 'version.json'
ver-script-part1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
ver-script-part2: "d = j['mkl-service'][0]; print('='.join((d[s] for s in ('version', 'build'))))"

jobs:
build:
Expand All @@ -42,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12', '3.13']
python: ${{ fromJSON(inputs.python-versions) }}
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
Expand All @@ -64,9 +65,6 @@ jobs:
run:
shell: bash -el {0}

env:
build-env-name: 'build'

steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -78,9 +76,8 @@ jobs:
uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
miniforge-version: latest
activate-environment: ${{ env.build-env-name }}
channels: conda-forge
python-version: ${{ matrix.python }}
activate-environment: ''

- name: Install conda-build
run: conda install -n base -y conda-build
Expand All @@ -98,10 +95,11 @@ jobs:
env:
CHANNELS_LIST: ${{ inputs.channels-list }}
RECIPE_DIR: ${{ inputs.recipe-dir }}
PYTHON_SPEC: ${{ matrix.python_spec || matrix.python }}
run: |
# CHANNELS_LIST intentionally word-splits into multiple -c args
# shellcheck disable=SC2086
conda build --no-test --python "${{ matrix.python_spec || matrix.python }}" ${CHANNELS_LIST} "${RECIPE_DIR}"
conda build --no-test --python "${PYTHON_SPEC}" ${CHANNELS_LIST} "${RECIPE_DIR}"

- name: Upload artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand All @@ -123,7 +121,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12', '3.13']
python: ${{ fromJSON(inputs.python-versions) }}
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
Expand All @@ -146,54 +144,31 @@ jobs:
shell: bash -el {0}

env:
test-env-name: 'test'
channel-path: './channel'
pkg-path-in-channel: './channel/${{ inputs.conda-subdir }}'
pkg-dir: './pkgs'

steps:
- name: Download artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ env.package-name }} ${{ runner.os }} Python ${{ matrix.python_tag || matrix.python }}
path: ${{ env.pkg-path-in-channel }}
path: ${{ env.pkg-dir }}

- name: Setup miniconda
uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
with:
miniforge-version: latest
channels: conda-forge
activate-environment: ${{ env.test-env-name }}
python-version: ${{ matrix.python }}

- name: Install conda-index
run: conda install -n base -y conda-index
activate-environment: ''

- name: Create conda channel
run: |
conda run -n base python -m conda_index ${{ env.channel-path }}

- name: Test conda channel
run: |
conda search ${{ env.package-name }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
cat ${{ env.ver-json-path }}

- name: Get package version
run: |
PACKAGE_VERSION=$(python -c "${{ env.ver-script-part1 }} ${{ env.ver-script-part2 }}")
export PACKAGE_VERSION

echo "PACKAGE_VERSION=${PACKAGE_VERSION}"
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> "$GITHUB_ENV"
- name: Install conda-build
run: conda install -n base -y conda-build

- name: Install mkl-service
run: |
conda install ${{ env.package-name }}=${{ env.PACKAGE_VERSION }} pytest "python=${{ matrix.python_spec || matrix.python }}" ${{ env.CHANNELS }}
- name: Test conda package
env:
CHANNELS: '-c ${{ env.channel-path }} ${{ inputs.channels-list }}'

- name: List installed packages
run: conda list

- name: Run tests
CHANNELS_LIST: ${{ inputs.channels-list }}
run: |
pytest -vv --pyargs ${{ env.module-name }}
# Runs the test section of the recipe embedded in the package, in a
# new environment whose Python comes from the package's python_abi
# CHANNELS_LIST intentionally word-splits into multiple -c args
# shellcheck disable=SC2086
conda build --test "${{ env.pkg-dir }}"/${{ env.package-name }}-*.conda ${CHANNELS_LIST}
7 changes: 6 additions & 1 deletion .github/workflows/conda-package-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Build like conda-forge/mkl-service-feedstock: the feedstock's Python versions
# plus 3.15t, which it doesn't build yet, and Visual Studio 2022 on Windows
jobs:
linux:
name: linux
Expand All @@ -22,15 +24,17 @@ jobs:
conda-subdir: linux-64
channels-list: -c conda-forge --override-channels
recipe-dir: conda-recipe-cf
python-versions: '["3.11", "3.12", "3.13"]'

windows:
name: windows
uses: ./.github/workflows/conda-build-test.yml
with:
runs-on: windows-latest
runs-on: windows-2022
conda-subdir: win-64
channels-list: -c conda-forge --override-channels
recipe-dir: conda-recipe-cf
python-versions: '["3.11", "3.12", "3.13"]'

osx:
name: osx
Expand All @@ -40,3 +44,4 @@ jobs:
conda-subdir: osx-64
channels-list: -c conda-forge --override-channels
recipe-dir: conda-recipe-cf
python-versions: '["3.11", "3.12", "3.13"]'
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ python -m pip install --no-deps --no-build-isolation .

## CI/CD
- **Platforms in CI workflows:** Linux, Windows, macOS (conda-forge workflow only)
- **Python versions:** 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, and free-threaded 3.14t and 3.15t
- **Python versions:** 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, and free-threaded 3.14t and 3.15t (`conda-package-cf.yml` takes the versions below 3.14 from the feedstock instead)
- **Python 3.14 ABI selection:** conda jobs must request an explicit ABI, `3.14.* *_cp314` (GIL) or `3.14.* *_cp314t` (free-threaded). Once the recipes stopped constraining `python-gil`, a bare `--python 3.14` was observed to resolve to the free-threaded build, so it must not be relied on.
- **Python 3.15 ABI selection:** same as 3.14; conda jobs request `3.15.* *_cp315` (GIL) or `3.15.* *_cp315t` (free-threaded) explicitly.
- **Workflows:** `.github/workflows/`
- `conda-package.yml` — main conda build/test pipeline
- `conda-package-cf.yml` — conda build/test using only conda-forge channel
- `conda-package-cf.yml` — conda build/test using only conda-forge channel, set up like `conda-forge/mkl-service-feedstock`
- `build-with-clang.yml` — Linux Clang compatibility
- `build-with-standard-clang.yml` — standard Clang compiler compatibility validation
- `build_pip.yml` — validates editable build
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe-cf/bld.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
%PYTHON% -m pip install --no-deps --no-build-isolation .
%PYTHON% -m pip install --no-deps --no-build-isolation -v .
if errorlevel 1 exit 1
2 changes: 1 addition & 1 deletion conda-recipe-cf/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash -ex
$PYTHON -m pip install --no-deps --no-build-isolation .
$PYTHON -m pip install --no-deps --no-build-isolation -v .
6 changes: 6 additions & 0 deletions conda-recipe-cf/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
c_compiler: # [linux]
- gcc # [linux]
c_compiler_version: # [linux]
- '15' # [linux]
c_stdlib: # [linux]
- sysroot # [linux]
c_stdlib_version: # [linux]
- '2.17' # [linux]
c_compiler: # [osx]
- clang # [osx]
c_compiler_version: # [osx]
- '21' # [osx]
c_stdlib: # [osx]
- macosx_deployment_target # [osx]
c_stdlib_version: # [osx]
Expand All @@ -16,3 +20,5 @@ c_stdlib: # [win]
- vs # [win]
c_compiler: # [win]
- vs2022 # [win]
mkl_devel: # [not osx]
- '2026' # [not osx]
4 changes: 2 additions & 2 deletions conda-recipe/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ Conda package build recipe for conda-forge and Intel channel distribution.
## CI usage
- Built in `.github/workflows/conda-package.yml`
- Artifacts uploaded per Python version and platform
- Test stage uses built artifacts from a temporary local channel
- Test stage runs `conda build --test` on the built artifact, so the `test:` section of the recipe is what CI runs

## Platform specifics
- **Linux:** RTLD_GLOBAL handling in runtime init path
- **Windows:** MKL library path configuration
- **macOS:** recipe scripts exist, but current GitHub Actions matrix does not build/test macOS
- **macOS:** built and tested only from `conda-recipe-cf/` in `conda-package-cf.yml`

## Maintenance
- Keep recipe metadata in sync with workflow matrix and package metadata
Expand Down
5 changes: 3 additions & 2 deletions mkl/tests/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ pytest mkl/tests/
```

## CI integration
- Tests run in `conda-package.yml` workflow
- Tests run in the `conda-package.yml` and `conda-package-cf.yml` workflows, through `conda build --test`, which runs the `test:` section of `conda-recipe/meta.yaml` or `conda-recipe-cf/meta.yaml`
- Test-only dependencies go in `test: requires:` of both recipes; CI installs nothing else
- Separate test jobs per Python version and CI platform
- CI coverage: Linux + Windows
- CI coverage: Linux + Windows, plus macOS in `conda-package-cf.yml`

## Adding tests
- New API functions → add to `test_mkl_service.py` with validation
Expand Down
Loading