Skip to content

Commit

Permalink
Issue natcap#16 using GH Act. setup-miniconda
Browse files Browse the repository at this point in the history
Using setup-miniconda as opposed to setup-conda as this resource
properly sets the GDAL_DATA and PROJ_LIB envs. Also setting GDAL to
3.0.4 as has better precision handling than 3.0.2 which is likely
related to bug fixes in handling SRS and forcing transformations in and
out of WGS84.
  • Loading branch information
dcdenu4 committed Mar 10, 2020
1 parent dbfea5a commit 7b0c7c5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.7]
os: [ubuntu-18.04]
python-version: [3.6, 3.7]
os: [ubuntu-18.04, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -24,26 +24,46 @@ jobs:
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: anaconda-client-env
python-version: 3.7
python-version: ${{ matrix.python-version }}
auto-activate-base: true
- name: Install dependencies
shell: bash
run: conda upgrade -y pip setuptools

- name: Install PyGeoprocessing (Windows)
if: matrix.os == 'windows-latest'
env:
PIP_EXTRA_INDEX_URL: "http://pypi.naturalcapitalproject.org/simple/"
PIP_TRUSTED_HOST: "pypi.naturalcapitalproject.org"
PIP_PREFER_BINARY: 1
shell: bash
# Replace numpy and scipy with PyPI versions to circumvent import issue.
# https://stackoverflow.com/a/37110747/299084
#
# Shapely 1.7.0 on PyPI has GEOS cdll issues in some environments. Gohlke builds work.
run: |
$CONDA/python -m pip install shapely --index-url http://pypi.naturalcapitalproject.org/simple/ -c requirements.txt
$CONDA/python -m pip install -r requirements.txt
$CONDA/python -m pip install $PACKAGES
$CONDA/python setup.py install
- name: Install PyGeoprocessing (Linux, Mac)
if: matrix.os != 'windows-latest'
shell: bash -l {0}
run: |
conda install --file requirements.txt
conda install $PACKAGES
python setup.py install
printenv
find /usr -name proj.db
- name: Test with pytest
- name: Lint with flake8
shell: bash -l {0}
run: pytest -s

run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
shell: bash -l {0}
run: pytest -s

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file records the packages and requirements needed in order for
# pygeoprocessing to work as expected.

GDAL>=3.0
GDAL==3.0.4
numpy>=1.10.1
scipy>=0.14.1,!=0.19.1
Shapely>=1.6.4
Expand Down

0 comments on commit 7b0c7c5

Please sign in to comment.