Install moments for MacOS py3.8 using setup.py #771
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: build | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-latest] | |
python-version: ["3.8", "3.10"] | |
include: | |
- os: windows-2019 | |
triplet: x64-windows | |
env: | |
CONDA_ENV_NAME: gadma_env | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Cancel previous runs. | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout. | |
uses: actions/checkout@v2 | |
- name: Set up Conda environment. | |
uses: conda-incubator/setup-miniconda@v3 | |
continue-on-error: true | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge,bioconda | |
activate-environment: ${{ env.CONDA_ENV_NAME }} | |
- name: Install dadi and scikit-allel using conda. | |
run: | | |
conda install dadi scikit-allel | |
- name: Install moments manually for MacOS (python3.8). | |
run: | | |
git clone https://github.com/MomentsLD/moments.git | |
cd moments | |
rm pyproject.toml | |
pip install -r requirements.txt | |
pip install . | |
if: runner.os == 'MacOS' && matrix.python-version == '3.8' | |
- name: Install moments using Pip. | |
run: | | |
pip install Cython==0.29.18 | |
pip install moments-popgen | |
if: runner.os != 'MacOS' || matrix.python-version != '3.8' | |
- name: Install GADMA and its dependencies. | |
run: | | |
# pip3 install Cython==0.29.18 # otherwise ConfigsSpace cause error for macOS | |
# TypeError: Expected float, got numpy.float64 when using Float | |
pip install . | |
- name: Install SMAC (Linux and MacOS for python3.8). | |
if: runner.os != 'Windows' && matrix.python-version == '3.8' | |
run: | | |
conda install swig "scipy<=1.6" | |
pip install -r requirements/bayes_opt.txt | |
- name: Check installations of packages. | |
run: | | |
python -c "import numpy" | |
python -c "import scipy" | |
python -c "import dadi" | |
python -c "import moments" | |
python -c "import gadma" | |
- name: Show versions of all installed packages. | |
run: | | |
conda list | |
- name: Show available engines and optimizations in gadma. | |
run: | | |
python -c "import gadma;print(gadma.engines.engine._registered_engines.keys())" | |
python -c "import gadma;print(gadma.optimizers.global_optimizer._registered_global_optimizers.keys())" | |
- name: Install dependencies for tests. | |
run: | | |
pip install -r requirements/tests.txt | |
- name: Run tests and codecov. | |
run: | | |
pytest --timeout=600 --cov=gadma --cov-report=xml -v tests --disable-warnings | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
if: runner.os == 'Linux' && matrix.python-version == '3.8' | |