Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI to use GitHub Actions #631

Merged
merged 43 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c9b96b5
bug
Dec 2, 2020
a07a9ad
add event trigger
Dec 2, 2020
0e2d083
duplicate steps removed
Dec 2, 2020
ff7460c
fix envt path
Dec 2, 2020
1f1726c
a slightly different setup
Dec 2, 2020
c554873
geopandas inspired
Dec 2, 2020
97ed8b8
single envt file
Dec 2, 2020
98335e5
run pytest
Dec 2, 2020
85a556e
simplify build for test
Dec 2, 2020
5efbb03
activate envt
Dec 2, 2020
1662a9a
activate envt
Dec 2, 2020
4b3e1d2
activate envt
Dec 2, 2020
cd9e733
update envt
Dec 2, 2020
2daa715
update envt
Dec 2, 2020
24caa30
update envt
Dec 2, 2020
c9d27f3
update envt
Dec 2, 2020
a760823
update envt
Dec 2, 2020
29b545a
update envt
Dec 2, 2020
9486d17
update envt
Dec 2, 2020
a4fcaa2
update envt
Dec 2, 2020
1dfc6b3
update envt
Dec 2, 2020
7997478
linting and docs
Dec 2, 2020
03f7559
linting and docs
Dec 2, 2020
7665364
linting and docs
Dec 2, 2020
d9d029d
docs in separate build
Dec 3, 2020
724629c
docs in separate build
Dec 3, 2020
86e9575
docs in separate build
Dec 3, 2020
365ec7b
small docs fix
Dec 3, 2020
cdc1c54
remove travis and appveyor
Dec 3, 2020
6e4e6dd
cleanup old travis and appveyor files
Dec 3, 2020
e08d9bb
install black and flake8
Dec 3, 2020
4987734
remove envt file
Dec 3, 2020
1efc0c0
black fixes
Dec 3, 2020
3dc57f2
update pre commit
Dec 3, 2020
3a88a40
black fixes
Dec 3, 2020
b31fcb0
run tests on all platforms
Dec 3, 2020
0356c8f
run on all platforms
Dec 3, 2020
09ae11a
break out linting steps for easier review
Dec 3, 2020
89eabfa
small fix
Dec 3, 2020
cd7f410
only run flake 8 on main code
Dec 3, 2020
1d70a63
skip windows for now
Dec 3, 2020
0d6715f
merge
Dec 3, 2020
9d4d457
conda forge
Dec 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow only runs linting and builds the documentation

name: Docs & Linting - Matrix OS / Python Version

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
setup-build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
pip install black flake8
pip install -e .
- name: Build Docs
run: |
make docs -B
- name: Run Black
run: |
flake8 earthpy
- name: Run Flake8
run: |
flake8 earthpy
52 changes: 52 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow runs tests for earthpy
# Because we want a conda environment - and that builds slower,
# we divided up tests from linting and docs to make for simpler install envts

name: Run Tests - Matrix OS / Python Version

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
example-1:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
conda-channels: conda-forge
python-version: ${{ matrix.python-version }}

- name: Install Env
shell: bash
run: |
python --version
#conda env create -f ci/environment.yml
conda install -c conda-forge matplotlib \
pytest requests \
geopandas rasterio scikit-image

- name: Check Environment
shell: bash
run: |
conda list
python --version
- name: Run Tests
shell: bash
run: |
pytest -v --color=yes
python --version
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: stable
rev: 20.8b1
hooks:
- id: black
language_version: python3.7
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.7
hooks:
Expand Down
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .travis/install.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .travis/test.sh

This file was deleted.

37 changes: 0 additions & 37 deletions appveyor.yml

This file was deleted.

1 change: 0 additions & 1 deletion earthpy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ def plot_bands(
... title=titles,
... figsize=(8, 3))
array([<AxesSubplot:title={'center':'Red'}>...

"""
show = False
try:
Expand Down
2 changes: 1 addition & 1 deletion earthpy/tests/test_plot_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_single_band_2dims(one_band_3dims):


def test_cbar_param(one_band_3dims):
"""Test that the colorbar param works for a single band arr."""
"""Test that the colorbar param works for a single band arr"""
one_band_2dims = one_band_3dims[0]
ax = ep.plot_bands(one_band_2dims, scale=True)
arr = ax.get_images()[0].get_array()
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
# Core scientific python
- numpy
- matplotlib
- python=3.6
# - python=3.6

# Geo stuff
- geopandas
Expand Down
5 changes: 4 additions & 1 deletion examples/plot_dem_hillshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@
hillshade = es.hillshade(elevation)

ep.plot_bands(
hillshade, cbar=False, title="Hillshade made from DTM", figsize=(10, 6),
hillshade,
cbar=False,
title="Hillshade made from DTM",
figsize=(10, 6),
)
plt.show()

Expand Down
4 changes: 2 additions & 2 deletions examples/plot_raster_stack_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@
#############################################################################
# Crop Individual Bands
# ---------------------
# If you only need to crop one raster image, you can use EarthPy's
# If you only need to crop one raster image, you can use EarthPy's
# ``es.crop_image()`` function.
# This function takes a Rasterio object and crops it to the provided
# This function takes a Rasterio object and crops it to the provided
# spatial extent.

# Open Landsat image as a Rasterio object in order to crop it
Expand Down
4 changes: 2 additions & 2 deletions examples/plot_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
bound_utm13N = bound.to_crs(raster_profile["crs"])

################################################################################
# Create a Plot With the Boundary overlayed on the RGB Image
# Create a Plot With the Boundary overlayed on the RGB Image
# ----------------------------------------------------------
# You can plot a polygon boundary over an image by creating a raster extent
# for the plot using the ``plotting_extent`` function from ``rasterio.plot``.
Expand Down Expand Up @@ -205,7 +205,7 @@
###############################################################################
# Create Figure with Multiple Axes or Subplots
# --------------------------------------------
# ```plot_rgb()`` has an ``ax=`` parameter which supports subplots. You can
# ```plot_rgb()`` has an ``ax=`` parameter which supports subplots. You can
# create figures that contain multiple plots by creating multiple ax
# objects, one for each plot. You can also specify the number of rows and
# columns in which to display the plots. In the example below, the two plots
Expand Down
30 changes: 0 additions & 30 deletions tox.ini

This file was deleted.