diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 31511176..6119a9d1 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,4 +1,5 @@ name: Build Status + on: [push, pull_request] jobs: @@ -6,6 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + os: [ubuntu-latest, macos-latest, windows-latest] python-version: - "3.6" - "3.7" @@ -21,18 +23,23 @@ jobs: - name: Setup miniconda uses: conda-incubator/setup-miniconda@v2 with: - miniconda-version: "latest" - - - name: Build environment + activate-environment: test + python-version: ${{ matrix.python-version }} + auto-activate-base: false + - name: Install dependencies + shell: bash -l {0} + run : | + conda install -c bioconda -c conda-forge \ + ngless pyrodigal megahit paladin pandas atomium tzlocal \ + "scikit-learn<1.3.0" "joblib<1.3.0" + conda install pytest + pip install . + - name: Test with pytest + shell: bash -l {0} run: | - conda install -y mamba -n base -c conda-forge - PYTHON_VERSION=${{ matrix.python-version }} ./install.sh - source /usr/share/miniconda3/bin/activate envs/Macrel_env/ - # Using conda/mamba to install pytest can cause other packages to be downgraded! - pip install pytest + python -m pytest macrel/tests - - name: Test Macrel + - name: Test Macrel CLI + shell: bash -l {0} run: | - source /usr/share/miniconda3/bin/activate envs/Macrel_env/ ./run-tests.sh - python -m pytest macrel/tests diff --git a/docs/install.md b/docs/install.md index aa9dcfb7..5029d0e0 100644 --- a/docs/install.md +++ b/docs/install.md @@ -9,17 +9,26 @@ conda install -c bioconda macrel ## Install from source -If you want to use an unreleased version from Github, for example, we provide a -script using _conda_ (in particular, using -[bioconda](https://bioconda.github.io/) and -[conda-forge](https://conda-forge.org/)) to install all dependencies in a -Macrel-specific environment: +If you want to use an unreleased version from Github, or tweak the code, we still recommend conda to manage the dependencies. You can install from source by running: ```bash git clone https://github.com/BigDataBiology/Macrel cd macrel -./install.sh -conda activate envs/Macrel_env + +conda create -n macrel_env +conda activate macrel_env +conda install -y \ + ngless \ + pyrodigal \ + megahit \ + paladin \ + pandas \ + "scikit-learn<1.3.0" \ + "joblib<1.3.0" \ + atomicwrites \ + tzlocal + +pip install . ``` Thereafter, to use macrel, activate this environment. diff --git a/install.sh b/install.sh deleted file mode 100755 index bb5b4867..00000000 --- a/install.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash - -set -v -set -e - -# This is set in travis -if [[ x$PYTHON_VERSION == x ]]; then - PYTHON_VERSION=3.7 -fi - - -echo " -# Macrel - (Meta)genomic AMP Classification and Retrieval -AUTHORS: Célio Dias Santos Júnior, Luis Pedro Coelho -" - -if ! which conda > /dev/null; then - echo "[ Conda not found. Please install miniconda and add 'conda' to the PATH: " - echo " curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" - echo " sh Miniconda3-latest-Linux-x86_64.sh" - exit 1 -fi - -eval "$(conda shell.bash hook)" - -BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - - -echo "# Creating new environment for Macrel" -mkdir -p envs -conda create --yes -p $BASEDIR/envs/Macrel_env python=$PYTHON_VERSION -conda config --env --add channels defaults -conda config --env --add channels bioconda -conda config --env --add channels conda-forge - -if ! which mamba > /dev/null; then - CONDA_INSTALL_CMD=conda -else - echo "# Installing packages with MAMBA" - CONDA_INSTALL_CMD=mamba -fi - -${CONDA_INSTALL_CMD} install -y \ - --prefix $BASEDIR/envs/Macrel_env \ - ngless \ - pyrodigal \ - megahit \ - paladin \ - pandas \ - "scikit-learn<1.3.0" \ - "joblib<1.3.0" \ - atomicwrites \ - tzlocal - -# only activate AFTER install all the packages to get the right environmental variables -source activate $BASEDIR/envs/Macrel_env - -# env forwards the current environment and sets some extra variables needed by -# ./recipe/build.sh -env \ - PYTHON=$(which python) \ - SRC_DIR=$PWD \ - PREFIX=$CONDA_PREFIX \ - ./recipe/build.sh - - -echo "############ Installation procedures finished -****** Thank you for installing Macrel ******** ---- Please submit bugreports/comments to -celio.diasjunior@gmail.com -or -https://github.com/BigDataBiology/macrel/issues -" diff --git a/recipe/build.sh b/recipe/build.sh deleted file mode 100755 index 0a9052d0..00000000 --- a/recipe/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -e - -$PYTHON -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed --no-deps -vv .