Skip to content

Commit

Permalink
Merge pull request #307 from johntruckenbrodt/github_actions_tests
Browse files Browse the repository at this point in the history
add conda build and test to GitHub actions
  • Loading branch information
johntruckenbrodt authored May 6, 2024
2 parents c6abc04 + 8125a82 commit fbc0375
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 8 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: conda build

on: [ push ]

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_PASSWORD: Password12!
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: '3.10'
- name: install ESA SNAP
run: |
wget -nv https://download.esa.int/step/snap/10_0/installers/esa-snap_sentinel_linux-10.0.0.sh
bash esa-snap_sentinel_linux-10.0.0.sh -q -dir $GITHUB_ACTION_PATH/esa-snap
- name: Set paths and variables
run: |
echo "$CONDA/bin" >> $GITHUB_PATH
echo "$GITHUB_ACTION_PATH/esa-snap/bin" >> $GITHUB_PATH
echo "PROJ_DATA=$CONDA/share/proj" >> $GITHUB_ENV
- name: Install dependencies
run: |
: # https://github.com/conda/conda/issues/13560#issuecomment-1992720842
conda install -y python=3.10
conda env update --file environment.yml --name base
- name: Lint with flake8
run: |
conda install flake8
# 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: Install package
run: |
pip install .
- name: Test with pytest
run: |
conda install pytest coverage
coverage run -m pytest
env:
PGUSER: postgres
PGPASSWORD: Password12!
- name: Publish to coveralls.io
uses: coverallsapp/github-action@v2
with:
github-token: ${{ github.token }}
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
- TESTDATA_DIR=$HOME/testdata
- PGUSER=travis
- PGPASSWORD=Password12!
- SNAP_VERSION=9
- SNAP_VERSION=10

addons:
postgresql: '14'
Expand All @@ -31,11 +31,11 @@ services:
- postgresql

python:
- '3.7'
- '3.10'

before_install:
- export SNAP_INSTALLER=esa-snap_sentinel_unix_"$SNAP_VERSION"_0_0.sh
- wget -O $SNAP_INSTALLER https://download.esa.int/step/snap/"$SNAP_VERSION".0/installers/"$SNAP_INSTALLER"
- export SNAP_INSTALLER=esa-snap_sentinel_linux-"$SNAP_VERSION".0.0.sh
- wget -O $SNAP_INSTALLER https://download.esa.int/step/snap/"$SNAP_VERSION"_0/installers/"$SNAP_INSTALLER"
- bash $SNAP_INSTALLER -q
- export PATH=$PATH:/opt/snap/bin

Expand All @@ -60,6 +60,3 @@ script:

after_success:
- coveralls

notifications:
slack: pyrosar:bs03zodEkRSYr8MN5HrgfSeB
2 changes: 1 addition & 1 deletion pyroSAR/S1/polysimplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def __init__(self, geom, precision=None, return_GDAL=True):
name = geom.geom_type.upper()
self.Geometry = lambda w: fromstr(w)
self.pts = np.array(geom.tuple)
elif isinstance(geom, unicode) or isinstance(geom, str):
elif isinstance(geom, str) or isinstance(geom, bytes):
# assume wkt
# for WKT
def str2tuple(q):
Expand Down

0 comments on commit fbc0375

Please sign in to comment.