From 89cabc4b3b201b04f407d29d1ec3dd5b8781bd74 Mon Sep 17 00:00:00 2001 From: "Bade, Jessica L" Date: Wed, 18 Dec 2024 12:25:12 -0800 Subject: [PATCH 1/5] Install and switch usage to conda-index --- .github/workflows/actions.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 1d4e6a6..4672f45 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -108,17 +108,25 @@ jobs: - name: Install dependencies run: | - mamba install boa anaconda-client conda-verify conda-build + mamba install boa anaconda-client conda-verify conda-build -y + mamba install -c conda-forge conda-index -y - name: Build conda package run: | - mkdir build/ + mkdir -p build/ conda mambabuild conda-recipe/ --output-folder build/ - conda index build/ + + - name: Index conda package + run: | + conda-index build/ - name: Convert to osx-arm64 run: conda convert -p osx-arm64 build/linux-64/*.tar.bz2 -o build/ + - name: Index converted package + run: | + conda-index build/ + - name: Upload packages env: ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} From f1808b3d46d41a1b7bdc4188047972dc3a0e2b72 Mon Sep 17 00:00:00 2001 From: Sean Colby Date: Wed, 18 Dec 2024 14:22:51 -0800 Subject: [PATCH 2/5] Simplify deploy setup --- .github/workflows/actions.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 4672f45..c017427 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -108,17 +108,12 @@ jobs: - name: Install dependencies run: | - mamba install boa anaconda-client conda-verify conda-build -y - mamba install -c conda-forge conda-index -y + mamba install boa anaconda-client conda-verify conda-index - name: Build conda package run: | mkdir -p build/ conda mambabuild conda-recipe/ --output-folder build/ - - - name: Index conda package - run: | - conda-index build/ - name: Convert to osx-arm64 run: conda convert -p osx-arm64 build/linux-64/*.tar.bz2 -o build/ From f0c9d9c380efd43afeb4915cb0647e809eba4384 Mon Sep 17 00:00:00 2001 From: Sean Colby Date: Wed, 18 Dec 2024 14:23:26 -0800 Subject: [PATCH 3/5] Switch to miniforge3 --- .github/workflows/actions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c017427..f1e41b7 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -34,7 +34,7 @@ jobs: - name: Setup environment uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge + miniforge-variant: miniforge3 miniforge-version: latest use-mamba: true environment-file: envs/linux.yml @@ -65,7 +65,7 @@ jobs: - name: Setup environment uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge + miniforge-variant: miniforge3 miniforge-version: latest use-mamba: true environment-file: envs/osx.yml @@ -98,7 +98,7 @@ jobs: - name: Setup environment uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge + miniforge-variant: miniforge3 miniforge-version: latest use-mamba: true python-version: 3.12 From 5afdb3b7a1957830f48a9a62f7b094ec31eb7cc7 Mon Sep 17 00:00:00 2001 From: Sean Colby Date: Wed, 18 Dec 2024 16:47:10 -0800 Subject: [PATCH 4/5] Migrate to rattler-build recipe/actions --- .github/workflows/actions.yml | 59 +++++++++---------- conda-recipe/conda_build_config.yaml | 6 -- .../meta.yaml => rattler-recipe/recipe.yaml | 15 +++-- rattler-recipe/variants.yaml | 6 ++ 4 files changed, 40 insertions(+), 46 deletions(-) delete mode 100644 conda-recipe/conda_build_config.yaml rename conda-recipe/meta.yaml => rattler-recipe/recipe.yaml (66%) create mode 100644 rattler-recipe/variants.yaml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f1e41b7..cbccdef 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -82,11 +82,18 @@ jobs: # pytest Deploy: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') needs: - Test_Linux - Test_Mac - runs-on: ubuntu-latest - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + target-platform: linux-64 + - os: macos-latest + target-platform: osx-arm64 defaults: run: shell: bash -l {0} @@ -94,37 +101,25 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - - name: Setup environment - uses: conda-incubator/setup-miniconda@v3 - with: - miniforge-variant: miniforge3 - miniforge-version: latest - use-mamba: true - python-version: 3.12 - channels: conda-forge,bioconda,smcolby - use-only-tar-bz2: false - auto-activate-base: true - - - name: Install dependencies - run: | - mamba install boa anaconda-client conda-verify conda-index - + - name: Build conda package - run: | - mkdir -p build/ - conda mambabuild conda-recipe/ --output-folder build/ - - - name: Convert to osx-arm64 - run: conda convert -p osx-arm64 build/linux-64/*.tar.bz2 -o build/ - - - name: Index converted package - run: | - conda-index build/ - - - name: Upload packages + uses: prefix-dev/rattler-build-action@v0.2.24 + with: + # Needs to be unique for each matrix entry + artifact-name: isicle-${{ matrix.target-platform }} + build-args: | + --target-platform ${{ matrix.target-platform }} + --recipe rattler-recipe/recipe.yaml + --variant-config rattler-recipe/variants.yaml + --output-dir build + -c conda-forge + -c bioconda + + - name: Upload conda package env: ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} run: | - anaconda upload build/linux-64/*.tar.bz2 - anaconda upload build/osx-arm64/*.tar.bz2 + for pkg in $(find build -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do + echo "Uploading ${pkg}" + rattler-build upload anaconda --owner smcolby "${pkg}" + done diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml deleted file mode 100644 index 7a11132..0000000 --- a/conda-recipe/conda_build_config.yaml +++ /dev/null @@ -1,6 +0,0 @@ - -python: - - 3.12 - - 3.11 - - 3.10 - - 3.9 diff --git a/conda-recipe/meta.yaml b/rattler-recipe/recipe.yaml similarity index 66% rename from conda-recipe/meta.yaml rename to rattler-recipe/recipe.yaml index 3465cd1..6b2e43c 100644 --- a/conda-recipe/meta.yaml +++ b/rattler-recipe/recipe.yaml @@ -1,9 +1,11 @@ -{% set data = load_setup_py_data(setup_file="../setup.py", - from_recipe_dir=True) %} +# {% set data = load_setup_py_data(setup_file="../setup.py", +# from_recipe_dir=True) %} +context: + version: "2.0.0" package: name: isicle - version: {{ data.get("version") }} + version: ${{ version }} source: path: .. @@ -17,7 +19,8 @@ extra: build: number: 0 - script: "{{ PYTHON }} -m pip install -vv --no-deps ." + script: + - python -m pip install -vv --no-deps . requirements: host: @@ -37,7 +40,3 @@ requirements: - snakemake >=6.3.0 - statsmodels >=0.11.1 - xtb >=6.5.1 - -test: - imports: - - isicle diff --git a/rattler-recipe/variants.yaml b/rattler-recipe/variants.yaml new file mode 100644 index 0000000..85030b5 --- /dev/null +++ b/rattler-recipe/variants.yaml @@ -0,0 +1,6 @@ + +python: + - "3.12" + - "3.11" + - "3.10" + - "3.9" From 765e1c578848e58c56ea4418abb19e7695c1a75d Mon Sep 17 00:00:00 2001 From: Sean Colby Date: Wed, 18 Dec 2024 16:54:38 -0800 Subject: [PATCH 5/5] Clean up formatting --- .github/workflows/actions.yml | 4 ++-- rattler-recipe/recipe.yaml | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index cbccdef..6c30c85 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -111,7 +111,7 @@ jobs: --target-platform ${{ matrix.target-platform }} --recipe rattler-recipe/recipe.yaml --variant-config rattler-recipe/variants.yaml - --output-dir build + --output-dir build/ -c conda-forge -c bioconda @@ -119,7 +119,7 @@ jobs: env: ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} run: | - for pkg in $(find build -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do + for pkg in $(find build/ -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do echo "Uploading ${pkg}" rattler-build upload anaconda --owner smcolby "${pkg}" done diff --git a/rattler-recipe/recipe.yaml b/rattler-recipe/recipe.yaml index 6b2e43c..d6861e8 100644 --- a/rattler-recipe/recipe.yaml +++ b/rattler-recipe/recipe.yaml @@ -1,7 +1,5 @@ -# {% set data = load_setup_py_data(setup_file="../setup.py", -# from_recipe_dir=True) %} context: - version: "2.0.0" + version: "2.0.0" # TODO: obtain this from package directly package: name: isicle