Skip to content

Support numba up to 0.65.1 and Python 3.14t #128

Support numba up to 0.65.1 and Python 3.14t

Support numba up to 0.65.1 and Python 3.14t #128

name: conda
on:
release:
types: [published]
pull_request:
paths:
- "buildscripts/conda-recipes/**"
- ".github/workflows/build-upload-conda.yml"
- "src/**"
- setup.py
- MANIFEST.in
- pyproject.toml
workflow_dispatch:
jobs:
# Job to deploy pyomp conda matrixed on os and python version.
deploy-conda:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
env:
CONDA_LABEL: dev
strategy:
matrix:
# TODO: Add windows.
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
steps:
- name: Determine conda label
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "CONDA_LABEL=dev" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.prerelease }}" == "true" ]]; then
echo "CONDA_LABEL=test" >> $GITHUB_ENV
else
echo "CONDA_LABEL=main" >> $GITHUB_ENV
fi
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
# Checkout the repo with history to get the commit hash for the build
# string.
with:
fetch-depth: 0
- name: Setup and activate base conda env
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
with:
# Keep Conda and conda-build on conda-forge so its build plugin loads.
miniforge-version: "26.3.2-3"
conda-remove-defaults: true
activate-environment: ""
auto-activate: true
auto-update-conda: false
show-channel-urls: true
- name: Build and upload pyomp
# This ensures conda env is active.
shell: bash -l {0}
run: |
# Setup the conda-forge environment.
conda install -n base -q -y --override-channels -c conda-forge conda-build anaconda-client
conda config --set anaconda_upload no
conda build --version
# Select the python variant; 3.14t needs the free-threaded ABI.
if [[ "${{ matrix.python-version }}" == "3.14t" ]]; then
PY_ARGS=(--python "3.14.* *_cp314t" -m buildscripts/conda-recipes/pyomp/freethreading.yaml)
else
PY_ARGS=(--python ${{ matrix.python-version }})
fi
# Build the package.
conda build \
-c conda-forge \
"${PY_ARGS[@]}" \
buildscripts/conda-recipes/pyomp
# Get the output file path.
OUTPUT=$(conda build -c conda-forge --output \
"${PY_ARGS[@]}" \
buildscripts/conda-recipes/pyomp)
# Upload the package.
conda run -n base anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload \
--user python-for-hpc --label ${{ env.CONDA_LABEL}} \
--force "$OUTPUT"
deploy-containers:
needs: deploy-conda
if: github.event_name == 'release' && !github.event.release.prerelease
uses: ./.github/workflows/build-containers.yml
secrets: inherit