-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,452 additions
and
260 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Test PyGeoprocessing | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
Test: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
PACKAGES: "shapely numpy scipy cython rtree!=0.9.1 pytest flake8 gdal<3" | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.6, 3.7] | ||
os: [ubuntu-16.04, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: setup-conda | ||
uses: s-weigand/[email protected] | ||
with: | ||
update-conda: false | ||
python-version: ${{ matrix.python-version }} | ||
conda-channels: defaults | ||
- 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 | ||
run: | | ||
$CONDA/python -m pip install $PACKAGES | ||
$CONDA/python setup.py install | ||
- name: Install PyGeoprocessing (Linux, Mac) | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
conda install $PACKAGES | ||
python setup.py install | ||
- name: Lint with flake8 | ||
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 | ||
run: pytest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: python | ||
|
||
os: linux | ||
|
||
services: | ||
- docker | ||
|
||
install: | ||
- docker pull natcap/pygeoprocessing-test:0.0.1 | ||
|
||
script: | ||
- docker run -it --rm -v `pwd`:/usr/local/pygeoprocessing natcap/pygeoprocessing-test:0.0.1 |
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 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 file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM conda/miniconda3 | ||
|
||
# this builds natcap/pygeoprocessing-test, should be run in the same directory | ||
# as the pygeoprocessing repository root like so: | ||
# docker run -it --rm -v `cwd`:/usr/local/pygeoprocessing natcap/pygeoprocessing-test:[TAG] | ||
# the [TAG] is defined in the .travis.yml file | ||
|
||
USER root | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
git \ | ||
libspatialindex-c4v5 \ | ||
mercurial \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
RUN conda create -y --name py37 python=3.7 && conda clean -a -y | ||
RUN conda run -v -n py37 conda install -c conda-forge gdal=2.4.1 | ||
RUN conda run -v -n py37 pip install --no-cache-dir \ | ||
cython \ | ||
ecoshard==0.3.1 \ | ||
pytest \ | ||
pytest-cov \ | ||
mock \ | ||
numpy \ | ||
retrying \ | ||
rtree \ | ||
scipy \ | ||
setuptools-scm \ | ||
shapely \ | ||
sympy \ | ||
taskgraph && conda clean -a -y | ||
|
||
RUN conda init bash && echo "source activate py37" > ~/.bashrc | ||
WORKDIR /usr/local/pygeoprocessing | ||
RUN echo "python setup.py install && pytest -xv tests" > /usr/local/run_pgp_tests.sh && chmod a+x /usr/local/run_pgp_tests.sh | ||
ENTRYPOINT /bin/bash -xci /usr/local/run_pgp_tests.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[build-system] | ||
# these are the minimum packages needed in order to execute the pygeoprocessing build. | ||
# Setuptools, wheel are from pep508. | ||
# NOTE: GDAL is *not* require here because the compiled cython module will | ||
# dynamically import GDAL via python's import system. This behavior means | ||
# that we can provide a much easier build experience so long as GDAL is | ||
# available at runtime. | ||
requires = ['setuptools', 'wheel', 'setuptools_scm', 'numpy', 'cython'] |
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 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
Oops, something went wrong.