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

test: Poetry on MacOS #115

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 28 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,48 +57,66 @@ jobs:
working-directory: flooding/sentinel2_water_extraction

test-poetry:
name: Test using Poetry on Python ${{ matrix.python }}
runs-on: ubuntu-22.04
name:
Test on ${{ matrix.runner }}, using Poetry with Python ${{ matrix.python
}}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- macos-12
- ubuntu-22.04
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
include:
- runner: macos-12
pip-cache-dir: ~/Library/Caches/pip
- runner: ubuntu-22.04
pip-cache-dir: ~/.cache/pip
steps:
- name: Check out repository
uses: actions/checkout@v3.3.0

- name: Use Python ${{ matrix.python }}
id: setup-python
uses: actions/setup-python@v4.5.0
with:
python-version: ${{ matrix.python }}

- name: Cache pip
uses: actions/cache@v3.2.3
with:
path: ~/.cache/pip
path: ${{ matrix.pip-cache-dir }}
key:
${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ matrix.python
}}-${{
hashFiles('./flooding/sentinel2_water_extraction/poetry.lock') }}
restore-keys:
${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ matrix.python }}-

- name: Update package registry
run: sudo apt-get update

- name: Install Poetry
run: pip install --disable-pip-version-check --progress-bar=off poetry

- name: Install GDAL
- name: Get GDAL Python package version
run:
sudo apt-get --assume-yes install libgdal-dev="$(poetry show gdal | tr
--delete ' ' | grep '^version:' | cut --delimiter=':' --fields=2)*"
echo "GDAL_VERSION=$(poetry show gdal | tr -d ' ' | grep '^version:' |
cut -d ':' -f 2)" >> $GITHUB_ENV
working-directory: flooding/sentinel2_water_extraction

- name: Setup Conda
uses: s-weigand/setup-conda@v1.1.1
with:
conda-channels: conda-forge
python-version: ${{ steps.setup-python.outputs.python-version }}

- name: Install Conda environment packages
run:
conda install --channel=conda-forge --quiet --yes gdal=${{
env.GDAL_VERSION }} poetry

- name: Install Python packages
run: poetry install --only=main --no-root
working-directory: flooding/sentinel2_water_extraction
Expand Down
3 changes: 2 additions & 1 deletion flooding/sentinel2_water_extraction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Below are the instructions to get the Notebook up and running

## Prerequisites

- Python 3.8, 3.9, 3.10, or 3.11
- Linux (tested on Ubuntu 22.04) or macOS (tested on version 12, Monterey)
- Python 3.8, 3.9, or 3.10
- GDAL 3.4

## Get the Jupyter Notebook
Expand Down