Skip to content

Commit 9c4562e

Browse files
committed
conda: build python-specific
1 parent afae0e2 commit 9c4562e

File tree

3 files changed

+18
-39
lines changed

3 files changed

+18
-39
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -71,49 +71,22 @@ jobs:
7171
runs-on: ${{ matrix.os }}-${{ matrix.os == 'windows' && '2022' || 'latest' }}
7272
strategy:
7373
matrix:
74+
python-version: ['3.10', 3.11, 3.12, 3.13] # parallelise conda_build_config.yaml
7475
os: [ubuntu, windows]
76+
include:
77+
- {python-version: 3.13, os: ubuntu}
7578
steps:
7679
- uses: actions/checkout@v4
7780
with: {fetch-depth: 0, submodules: recursive}
7881
- if: matrix.os == 'windows'
7982
uses: ilammy/msvc-dev-cmd@v1
80-
- uses: conda-incubator/setup-miniconda@v3
81-
with:
82-
python-version: 3.12
83-
mamba-version: "*"
84-
channels: conda-forge
85-
conda-remove-defaults: "true"
86-
- run: conda install boa conda-verify
87-
- name: conda build
88-
run: >
89-
conda mambabuild -c conda-forge --override-channels --output-folder dist recipe --no-test
90-
- uses: actions/upload-artifact@v4
91-
with:
92-
name: ccpi-regulariser-${{ matrix.os }}
93-
path: dist/*/ccpi-regulariser-*.tar.bz2
94-
conda-test:
95-
defaults: {run: {shell: 'bash -el {0}'}}
96-
runs-on: ${{ matrix.os }}-latest
97-
needs: [conda-build]
98-
strategy:
99-
matrix:
100-
python-version: ['3.10', 3.11, 3.12] # parallelise conda_build_config.yaml
101-
os: [ubuntu, windows]
102-
include:
103-
- {python-version: 3.13, os: ubuntu}
104-
steps:
105-
- uses: actions/checkout@v4
10683
- uses: conda-incubator/setup-miniconda@v3
10784
with:
10885
python-version: ${{ matrix.python-version }}
10986
mamba-version: "*"
11087
channels: conda-forge
11188
conda-remove-defaults: "true"
112-
- uses: actions/download-artifact@v4
113-
with:
114-
name: ccpi-regulariser-${{ matrix.os }}
115-
path: dist
116-
- name: conda test
89+
- name: conda build
11790
run: |
11891
if test ${{ matrix.python-version }} = 3.13; then
11992
BUILD_DEP=conda-build
@@ -122,8 +95,12 @@ jobs:
12295
BUILD_DEP=boa
12396
BUILD_CMD="conda mambabuild"
12497
fi
125-
conda install $BUILD_DEP
126-
$BUILD_CMD -c conda-forge --override-channels dist/*/ccpi-regulariser-*-cpu_h*.tar.bz2 --test --python=${{ matrix.python-version }}
98+
mamba install $BUILD_DEP conda-verify
99+
$BUILD_CMD -c conda-forge --override-channels --output-folder dist recipe --python=${{ matrix.python-version }}
100+
- uses: actions/upload-artifact@v4
101+
with:
102+
name: ccpi-regulariser-py${{ matrix.python-version}}-${{ matrix.os }}
103+
path: dist/*/ccpi-regulariser-*.tar.bz2
127104
conda-upload:
128105
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
129106
defaults: {run: {shell: 'bash -el {0}', working-directory: dist}}
@@ -152,6 +129,6 @@ jobs:
152129
ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \
153130
'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"'
154131
pass:
155-
needs: [test-cuda, test, conda-test]
132+
needs: [test-cuda, test, conda-build]
156133
runs-on: ubuntu-latest
157134
steps: [{run: echo success}]

recipe/conda_build_config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
python:
2+
- 3.10
3+
- 3.11
4+
- 3.12
5+
- 3.13
16
cuda_compiler_version:
27
- None
38
- 12.9

recipe/meta.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# https://docs.conda.io/projects/conda-build/en/stable/resources/define-metadata.html#loading-data-from-other-files
22
# TODO: use scikit-build-core & setuptools_scm instead
3-
{% set python_min = "3.10" %}
43
{% set project = load_file_data('../src/Python/pyproject.toml', from_recipe_dir=True).get('project', {}) %}
54
{% set build_number = environ.get('GIT_DESCRIBE_NUMBER', 0) | int %}
65
{% if cuda_compiler_version != "None" %}
@@ -14,7 +13,6 @@ package:
1413
build:
1514
preserve_egg_dir: False
1615
number: {{ build_number }}
17-
python_version_independent: true
1816
run_exports:
1917
- {{ pin_subpackage(project.get('name'), max_pin='x.x') }}
2018
- {{ project.get('name') }} =*=cuda* # [cuda_compiler_version != "None"]
@@ -41,19 +39,18 @@ requirements:
4139
build:
4240
- cmake
4341
- ninja
44-
- python # [build_platform != target_platform]
4542
- {{ compiler('cxx') }}
4643
#- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
4744
- cuda-compiler ~={{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
4845
host:
49-
- python ~={{ python_min }}
46+
- python
5047
- llvm-openmp
5148
- setuptools
5249
- pip
5350
- cuda-cccl # [cuda_compiler_version != "None"]
5451
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
5552
run:
56-
- python >={{ python_min }}
53+
- python
5754
- numpy
5855
- __cuda # [cuda_compiler_version != "None"]
5956
- {{ pin_compatible('cuda-version', min_pin='x', max_pin='x') }} # [cuda_compiler_version != "None"]

0 commit comments

Comments
 (0)