-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use short options for `tr` and `cut`, for compatibility with the macOS tools. Installing GDAL with Conda is one of the few cross-platform installation methods available: - GDAL 3.4.1 is not available for installation with brew <https://formulae.brew.sh/formula/gdal>. - Poetry ignores declaration of different versions for macOS and Linux <python-poetry/poetry#5506>. Unfortunately Conda does not yet support Python 3.11 <conda/conda#11170>, so I've dropped that.
- Loading branch information
Showing
2 changed files
with
27 additions
and
14 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 |
---|---|---|
|
@@ -57,53 +57,65 @@ 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/[email protected] | ||
|
||
- name: Use Python ${{ matrix.python }} | ||
id: setup-python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Cache pip | ||
uses: actions/[email protected] | ||
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: Get GDAL Python package version | ||
run: | ||
echo "GDAL_VERSION=$(poetry show gdal | tr --delete ' ' | grep | ||
'^version:' | cut --delimiter=':' --fields=2)" >> $GITHUB_ENV | ||
echo "GDAL_VERSION=$(poetry show gdal | tr -d ' ' | grep '^version:' | | ||
cut -d ':' -f 2)" >> $GITHUB_ENV | ||
working-directory: flooding/sentinel2_water_extraction | ||
|
||
- name: Install GDAL | ||
- name: Setup Conda | ||
uses: s-weigand/[email protected] | ||
with: | ||
conda-channels: conda-forge | ||
python-version: ${{ steps.setup-python.outputs.python-version }} | ||
|
||
- name: Install Conda environment packages | ||
run: | ||
sudo apt-get --assume-yes install "libgdal-dev=${{ env.GDAL_VERSION | ||
}}*" | ||
working-directory: flooding/sentinel2_water_extraction | ||
conda install --channel=conda-forge --quiet --yes gdal=${{ | ||
env.GDAL_VERSION }} poetry | ||
|
||
- name: Install Python packages | ||
run: poetry install --only=main --no-root | ||
|
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