Skip to content

Commit

Permalink
Merge pull request #28 from pnnl/noarch-build
Browse files Browse the repository at this point in the history
Build to anaconda noarch distribution
  • Loading branch information
Sean M. Colby authored Dec 19, 2024
2 parents 2b7e8cb + aad2d83 commit 5f9c2f3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 47 deletions.
53 changes: 18 additions & 35 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-variant: miniforge3
miniforge-version: latest
use-mamba: true
environment-file: environment.yml
Expand All @@ -49,7 +49,7 @@ jobs:
activate-environment: deimos

- name: Install DEIMoS
run: pip install -e .
run: pip install --no-deps .

- name: Test environment
run: |
Expand All @@ -58,49 +58,32 @@ jobs:
pytest
Deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- Test
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
python-version: 3.12
channels: conda-forge,bioconda
use-only-tar-bz2: true
auto-activate-base: true

- name: Install dependencies
run: |
mamba install boa anaconda-client conda-verify
uses: actions/checkout@v4

- name: Build conda package
run: |
mkdir build/
conda mambabuild conda-recipe/ --output-folder build/
conda index build/
uses: prefix-dev/[email protected]
with:
recipe-path: conda.recipe/recipe.yaml
build-args: >
--output-dir build/
-c conda-forge
-c bioconda
- name: Convert to win-64
run: conda convert -p win-64 build/linux-64/*.tar.bz2 -o build/

- name: Convert to osx-64
run: conda convert -p osx-64 build/linux-64/*.tar.bz2 -o build/

- name: Upload packages
- name: Upload conda package
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
ANACONDA_API_KEY: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda upload build/linux-64/*.tar.bz2
anaconda upload build/osx-64/*.tar.bz2
anaconda upload build/win-64/*.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
21 changes: 9 additions & 12 deletions conda-recipe/meta.yaml → conda.recipe/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set data = load_setup_py_data(setup_file='../setup.py',
from_recipe_dir=True) %}
context:
version: "1.5.0" # TODO: obtain this from package directly

package:
name: deimos
version: {{ data.get('version') }}
version: ${{ version }}

source:
path: ..
Expand All @@ -14,15 +14,18 @@ extra:
- bioconda

build:
noarch: python
number: 0
script: "{{ PYTHON }} -m pip install -vv --no-deps ."
entry_points:
- deimos = deimos.cli:main
script: python -m pip install -vv --no-deps .
python:
entry_points:
- deimos = deimos.cli:main

requirements:
host:
- python
- pip
- setuptools
run:
- dask
- h5py
Expand All @@ -39,9 +42,3 @@ requirements:
- snakemake <8
- statsmodels
- tabula-py

test:
imports:
- deimos
commands:
- deimos -h

0 comments on commit 5f9c2f3

Please sign in to comment.