From 5def11ed60118869fb27ba4866221393275659b0 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Tue, 17 Jan 2023 14:13:37 +1300 Subject: [PATCH] test: Poetry on Windows Works around flaky temporary directory removal on Windows . --- .github/workflows/test.yml | 19 ++++++++++++++++++- flooding/sentinel2_water_extraction/README.md | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53b14686..7d1275e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,6 +67,7 @@ jobs: runner: - macos-12 - ubuntu-22.04 + - windows-2022 python: - "3.8" - "3.9" @@ -76,6 +77,8 @@ jobs: pip-cache-dir: ~/Library/Caches/pip - runner: ubuntu-22.04 pip-cache-dir: ~/.cache/pip + - runner: windows-2022 + pip-cache-dir: ~\AppData\Local\pip\Cache steps: - name: Check out repository uses: actions/checkout@v3.3.0 @@ -104,6 +107,7 @@ jobs: run: echo "GDAL_VERSION=$(poetry show gdal | tr -d ' ' | grep '^version:' | cut -d ':' -f 2)" >> $GITHUB_ENV + shell: bash working-directory: flooding/sentinel2_water_extraction - name: Setup Conda @@ -117,9 +121,22 @@ jobs: conda install --channel=conda-forge --quiet --yes gdal=${{ env.GDAL_VERSION }} poetry - - name: Install Python packages + - name: Install Python packages on non-Windows runner run: poetry install --only=main --no-root working-directory: flooding/sentinel2_water_extraction + if: ${{ !startsWith(runner.os, 'Windows') }} + + - name: + Install Python packages on Windows runner (remove after + https://github.com/python-poetry/poetry-core/pull/460 is released) + uses: nick-fields/retry@v2.8.3 + with: + timeout_minutes: 9999 # Work around https://github.com/nick-fields/retry/issues/107 + max_attempts: 6 + command: cd flooding/sentinel2_water_extraction && poetry install + --only=main --no-root # https://github.com/python-poetry/poetry/issues/7363, https://github.com/nick-fields/retry/issues/89 + shell: bash + if: ${{ startsWith(runner.os, 'Windows') }} - name: Run test run: diff --git a/flooding/sentinel2_water_extraction/README.md b/flooding/sentinel2_water_extraction/README.md index 5ace7d75..fecde97d 100644 --- a/flooding/sentinel2_water_extraction/README.md +++ b/flooding/sentinel2_water_extraction/README.md @@ -7,7 +7,8 @@ Below are the instructions to get the Notebook up and running ## Prerequisites -- Linux (tested on Ubuntu 22.04) or macOS (tested on version 12, Monterey) +- Linux (tested on Ubuntu 22.04), macOS (tested on version 12, Monterey), or + Windows (tested on Windows Server 2022) - Python 3.8, 3.9, or 3.10 - GDAL 3.4