use conda to install test deps
MODIFY
.github/workflows/main.yaml
.github/workflows/main.yaml
@@ -71,23 +71,32 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- - uses: actions/cache@v1
+ - name: Cache conda
+ uses: actions/cache@v1
+ env:
+ # Increase this value to reset cache if ci/py${{ matrix.python-version }}.yml has not changed
+ CACHE_NUMBER: 0
with:
- path: ~/.cache/pip
- key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
- restore-keys: |
- ${{ runner.os }}-pip-
- - run: |
- python -m pip install -r dev-requirements.txt
+ path: ~/conda_pkgs_dir
+ key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/py${{ matrix.python-version }}.yml') }}
+ - name: setup miniconda
+ uses: goanpeca/setup-miniconda@v1
+ with:
+ activate-environment: pangeo-forge
+ environment-file: ci/py${{ matrix.python-version }}.yml
+ python-version: ${{ matrix.python-version }}
+ auto-activate-base: false
+ use-only-tar-bz2: true
+ - name: print conda env
+ shell: bash -l {0}
+ run: |
+ conda info
+ conda list
+ - name: install pangeo-forge
+ shell: bash -l {0}
+ run: |
python -m pip install --no-deps -e .
- python -m pip list
- name: Running Tests
+ shell: bash -l {0}
run: |
python -m pytest --log-cli-level=WARNING --verbose
- --junitxml=test-reports/junit.xml --cov=pangeo_forge --cov-config .coveragerc --cov-report term-missing
- tests
- # - name: Upload coverage to Codecov
- # uses: codecov/codecov-action@v1
- # with:
- # token: ${{ secrets.CODECOV_TOKEN }}
- # file: test-reports/junit.xml

ADD
ci/py37.yml
+name: pangeo-forge
+channels:
+ - conda-forge
+dependencies:
+ - python=3.7
+ - black
+ - boto3
+ - cfgrib
+ - dask
+ - distributed
+ - fsspec
+ - h5netcdf
+ - h5py
+ - hdf5
+ - lxml # Optional dep of pydap
+ - netcdf4
+ - numpy
+ - pandas
+ - pip
+ - pydap
+ - pynio
+ - pytest
+ - rasterio
+ - scipy
+ - setuptools
+ - toolz
+ - zarr

ADD
ci/py38.yml
+name: pangeo-forge
+channels:
+ - conda-forge
+dependencies:
+ - python=3.8
+ - black
+ - boto3
+ - cfgrib
+ - dask
+ - distributed
+ - fsspec
+ - h5netcdf
+ - h5py
+ - hdf5
+ - lxml # Optional dep of pydap
+ - netcdf4
+ - numpy
+ - pandas
+ - pip
+ - pydap
+ - pynio
+ - pytest
+ - rasterio
+ - scipy
+ - setuptools
+ - toolz
+ - zarr

MODIFY
setup.cfg
setup.cfg
@@ -3,7 +3,7 @@ max-line-length = 100
[isort]
known_first_party=pangeo_forge
-known_third_party=click,fsspec,pandas,pkg_resources,prefect,setuptools,zarr
+known_third_party=click,fsspec,numpy,pandas,pkg_resources,prefect,pytest,setuptools,xarray,zarr
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0

MODIFY
tests/test_pipeline.py
tests/test_pipeline.py
import subprocess
-import pytest
+import fsspec
import numpy as np
-import xarray as xr
import pandas as pd
-import fsspec
+import pytest
+import xarray as xr
@pytest.fixture(scope="session")

use conda to install test deps