From 05c52b696e3cccc453a6c49e4cad8c37ecfcc0c3 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 17 Oct 2025 15:55:56 +0100 Subject: [PATCH 1/2] conda: build python-specific partially reverts 2900e0d --- .github/workflows/build.yml | 48 +++++++++------------------------- recipe/conda_build_config.yaml | 5 ++++ recipe/meta.yaml | 6 ++--- 3 files changed, 20 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e9dcb7..531465a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,32 +69,6 @@ jobs: conda-build: defaults: {run: {shell: 'bash -el {0}'}} runs-on: ${{ matrix.os }}-${{ matrix.os == 'windows' && '2022' || 'latest' }} - strategy: - matrix: - os: [ubuntu, windows] - steps: - - uses: actions/checkout@v4 - with: {fetch-depth: 0, submodules: recursive} - - if: matrix.os == 'windows' - uses: ilammy/msvc-dev-cmd@v1 - - uses: conda-incubator/setup-miniconda@v3 - with: - python-version: 3.12 - mamba-version: "*" - channels: conda-forge - conda-remove-defaults: "true" - - run: conda install boa conda-verify - - name: conda build - run: > - conda mambabuild -c conda-forge --override-channels --output-folder dist recipe --no-test - - uses: actions/upload-artifact@v4 - with: - name: ccpi-regulariser-${{ matrix.os }} - path: dist/*/ccpi-regulariser-*.tar.bz2 - conda-test: - defaults: {run: {shell: 'bash -el {0}'}} - runs-on: ${{ matrix.os }}-latest - needs: [conda-build] strategy: matrix: python-version: ['3.10', 3.11, 3.12] # parallelise conda_build_config.yaml @@ -103,17 +77,16 @@ jobs: - {python-version: 3.13, os: ubuntu} steps: - uses: actions/checkout@v4 + with: {fetch-depth: 0, submodules: recursive} + - if: matrix.os == 'windows' + uses: ilammy/msvc-dev-cmd@v1 - uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} mamba-version: "*" channels: conda-forge conda-remove-defaults: "true" - - uses: actions/download-artifact@v4 - with: - name: ccpi-regulariser-${{ matrix.os }} - path: dist - - name: conda test + - name: conda build run: | if test ${{ matrix.python-version }} = 3.13; then BUILD_DEP=conda-build @@ -122,13 +95,18 @@ jobs: BUILD_DEP=boa BUILD_CMD="conda mambabuild" fi - conda install $BUILD_DEP - $BUILD_CMD -c conda-forge --override-channels dist/*/ccpi-regulariser-*-cpu_h*.tar.bz2 --test --python=${{ matrix.python-version }} + conda install $BUILD_DEP conda-verify + $BUILD_CMD -c conda-forge --override-channels --output-folder dist recipe --python=${{ matrix.python-version }} --no-test + $BUILD_CMD -c conda-forge --override-channels --test dist/*/ccpi-regulariser-*-cpu_*.tar.bz2 + - uses: actions/upload-artifact@v4 + with: + name: ccpi-regulariser-py${{ matrix.python-version}}-${{ matrix.os }} + path: dist/*/ccpi-regulariser-*.tar.bz2 conda-upload: if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') defaults: {run: {shell: 'bash -el {0}', working-directory: dist}} runs-on: ubuntu-latest - needs: conda-test + needs: conda-build steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v3 @@ -152,6 +130,6 @@ jobs: ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \ 'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"' pass: - needs: [test-cuda, test, conda-test] + needs: [test-cuda, test, conda-build] runs-on: ubuntu-latest steps: [{run: echo success}] diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 176d25d..bd6b93c 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,3 +1,8 @@ +python: + - 3.10 + - 3.11 + - 3.12 + - 3.13 cuda_compiler_version: - None - 12.9 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4c52569..3ec9abe 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,7 +13,6 @@ package: build: preserve_egg_dir: False number: {{ build_number }} - noarch: python run_exports: - {{ pin_subpackage(project.get('name'), max_pin='x.x') }} - {{ project.get('name') }} =*=cuda* # [cuda_compiler_version != "None"] @@ -40,19 +39,18 @@ requirements: build: - cmake - ninja - - python # [build_platform != target_platform] - {{ compiler('cxx') }} #- {{ compiler('cuda') }} # [cuda_compiler_version != "None"] - cuda-compiler ~={{ cuda_compiler_version }} # [cuda_compiler_version != "None"] host: - - python >=3.10 + - python x.x - llvm-openmp - setuptools - pip - cuda-cccl # [cuda_compiler_version != "None"] - cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"] run: - - python >=3.10 + - {{ pin_compatible('python', min_pin='x.x', max_pin='x') }} - numpy - __cuda # [cuda_compiler_version != "None"] - {{ pin_compatible('cuda-version', min_pin='x', max_pin='x') }} # [cuda_compiler_version != "None"] From bf4e2d80b5fc61fe0523cd70396bb29887c3425e Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 22 Oct 2025 13:26:55 +0100 Subject: [PATCH 2/2] minor tidy --- .github/workflows/build.yml | 2 +- recipe/meta.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 531465a..abb6af3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: conda-remove-defaults: "true" - uses: actions/download-artifact@v4 with: {pattern: ccpi-regulariser-*, path: dist, merge-multiple: true} - - run: conda install anaconda-client + - run: mamba install anaconda-client - name: anaconda upload -c ccpi run: > anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3ec9abe..1dd7283 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -51,7 +51,9 @@ requirements: - cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"] run: - {{ pin_compatible('python', min_pin='x.x', max_pin='x') }} - - numpy + {% for dep in project.get("dependencies") %} + - {{ dep.lower() }} + {% endfor %} - __cuda # [cuda_compiler_version != "None"] - {{ pin_compatible('cuda-version', min_pin='x', max_pin='x') }} # [cuda_compiler_version != "None"]