Skip to content

Commit 674e746

Browse files
authored
Merge pull request #219 from TomographicImaging/fix-conda-arch
fix conda arch
2 parents 2d41edb + bf4e2d8 commit 674e746

File tree

3 files changed

+24
-41
lines changed

3 files changed

+24
-41
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,6 @@ jobs:
6969
conda-build:
7070
defaults: {run: {shell: 'bash -el {0}'}}
7171
runs-on: ${{ matrix.os }}-${{ matrix.os == 'windows' && '2022' || 'latest' }}
72-
strategy:
73-
matrix:
74-
os: [ubuntu, windows]
75-
steps:
76-
- uses: actions/checkout@v4
77-
with: {fetch-depth: 0, submodules: recursive}
78-
- if: matrix.os == 'windows'
79-
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]
9872
strategy:
9973
matrix:
10074
python-version: ['3.10', 3.11, 3.12] # parallelise conda_build_config.yaml
@@ -103,17 +77,16 @@ jobs:
10377
- {python-version: 3.13, os: ubuntu}
10478
steps:
10579
- uses: actions/checkout@v4
80+
with: {fetch-depth: 0, submodules: recursive}
81+
- if: matrix.os == 'windows'
82+
uses: ilammy/msvc-dev-cmd@v1
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,13 +95,18 @@ 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+
conda install $BUILD_DEP conda-verify
99+
$BUILD_CMD -c conda-forge --override-channels --output-folder dist recipe --python=${{ matrix.python-version }} --no-test
100+
$BUILD_CMD -c conda-forge --override-channels --test dist/*/ccpi-regulariser-*-cpu_*.tar.bz2
101+
- uses: actions/upload-artifact@v4
102+
with:
103+
name: ccpi-regulariser-py${{ matrix.python-version}}-${{ matrix.os }}
104+
path: dist/*/ccpi-regulariser-*.tar.bz2
127105
conda-upload:
128106
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
129107
defaults: {run: {shell: 'bash -el {0}', working-directory: dist}}
130108
runs-on: ubuntu-latest
131-
needs: conda-test
109+
needs: conda-build
132110
steps:
133111
- uses: actions/checkout@v4
134112
- uses: conda-incubator/setup-miniconda@v3
@@ -138,7 +116,7 @@ jobs:
138116
conda-remove-defaults: "true"
139117
- uses: actions/download-artifact@v4
140118
with: {pattern: ccpi-regulariser-*, path: dist, merge-multiple: true}
141-
- run: conda install anaconda-client
119+
- run: mamba install anaconda-client
142120
- name: anaconda upload -c ccpi
143121
run: >
144122
anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force
@@ -152,6 +130,6 @@ jobs:
152130
ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \
153131
'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"'
154132
pass:
155-
needs: [test-cuda, test, conda-test]
133+
needs: [test-cuda, test, conda-build]
156134
runs-on: ubuntu-latest
157135
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ package:
1313
build:
1414
preserve_egg_dir: False
1515
number: {{ build_number }}
16-
noarch: python
1716
run_exports:
1817
- {{ pin_subpackage(project.get('name'), max_pin='x.x') }}
1918
- {{ project.get('name') }} =*=cuda* # [cuda_compiler_version != "None"]
@@ -40,20 +39,21 @@ requirements:
4039
build:
4140
- cmake
4241
- ninja
43-
- python # [build_platform != target_platform]
4442
- {{ compiler('cxx') }}
4543
#- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
4644
- cuda-compiler ~={{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
4745
host:
48-
- python >=3.10
46+
- python x.x
4947
- llvm-openmp
5048
- setuptools
5149
- pip
5250
- cuda-cccl # [cuda_compiler_version != "None"]
5351
- cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"]
5452
run:
55-
- python >=3.10
56-
- numpy
53+
- {{ pin_compatible('python', min_pin='x.x', max_pin='x') }}
54+
{% for dep in project.get("dependencies") %}
55+
- {{ dep.lower() }}
56+
{% endfor %}
5757
- __cuda # [cuda_compiler_version != "None"]
5858
- {{ pin_compatible('cuda-version', min_pin='x', max_pin='x') }} # [cuda_compiler_version != "None"]
5959

0 commit comments

Comments
 (0)