From e5559a631baf0248fadee1df7dc957ee7247e67f Mon Sep 17 00:00:00 2001 From: eli knaap Date: Wed, 6 Mar 2024 13:02:38 -0800 Subject: [PATCH 01/11] update testing --- .github/workflows/unittests.yml | 127 +++++++++++++++++--------------- {.ci => ci}/310.yml | 0 {.ci => ci}/311.yml | 0 .ci/39.yml => ci/312.yml | 2 +- 4 files changed, 70 insertions(+), 59 deletions(-) rename {.ci => ci}/310.yml (100%) rename {.ci => ci}/311.yml (100%) rename .ci/39.yml => ci/312.yml (97%) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 7d8f2a2b..458aeea6 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,60 +1,71 @@ - name: Unit Tests - on: - push: - branches: - - '*' - pull_request: - branches: - - '*' - schedule: - - cron: '59 23 * * *' +name: Tests - jobs: - unittests: - name: CI (${{ matrix.os }}-${{ matrix.environment-file }}) - runs-on: ${{ matrix.os }} - continue-on-error: false - timeout-minutes: 45 - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - environment-file: [.ci/39.yml, .ci/310.yml, .ci/311.yml] - experimental: [false] - fail-fast: [false] +on: + push: + branches: [main] + pull_request: + branches: + - "*" + schedule: + - cron: "0 0 * * 1,4" - steps: - - name: checkout repo - uses: actions/checkout@v2 - - - name: setup micromamba - uses: mamba-org/provision-with-micromamba@main - with: - environment-file: ${{ matrix.environment-file }} - micromamba-version: 'latest' - - - name: reinstall segregation - bash - shell: bash -l {0} - run: pip install -e . --no-deps --force-reinstall - if: matrix.os != 'windows-latest' - - - name: reinstall segregation - powershell - shell: powershell - run: pip install -e . --no-deps --force-reinstall - if: matrix.os == 'windows-latest' - - - name: run pytest - bash - shell: bash -l {0} - run: pytest -v segregation --cov=segregation --cov-report=xml - if: matrix.os != 'windows-latest' - - - name: run pytest - powershell - shell: powershell - run: pytest -v segregation --cov=segregation --cov-report=xml - if: matrix.os == 'windows-latest' - - - name: codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - name: segregation-codecov +jobs: + Test: + name: ${{ matrix.os }}, ${{ matrix.environment-file }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + environment-file: + - ci/310.yml + - ci/311.yml + - ci/312.yml + include: + - environment-file: .ci/311.yml + os: macos-latest + - environment-file: .ci/311.yml + os: macos-14 # Apple Silicon + - environment-file: .ci/311.yml + os: windows-latest + defaults: + run: + shell: bash -l {0} + + steps: + - uses: actions/checkout@v4 + + - name: setup micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ${{ matrix.environment-file }} + micromamba-version: 'latest' + + - name: Test segregation + run: | + coverage run -m pytest \ + -v \ + -r a \ + -n auto \ + --color yes \ + --cov segregation \ + --cov-append \ + --cov-report term-missing \ + --cov-report xml \ + segregation + - name: codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + name: segregation-codecov + + - name: Generate and publish the report + if: | + failure() + && steps.status.outcome == 'failure' + && github.event_name == 'schedule' + && github.repository_owner == 'oturns' + uses: xarray-contrib/issue-from-pytest-log@v1 + with: + log-path: pytest-log.jsonl diff --git a/.ci/310.yml b/ci/310.yml similarity index 100% rename from .ci/310.yml rename to ci/310.yml diff --git a/.ci/311.yml b/ci/311.yml similarity index 100% rename from .ci/311.yml rename to ci/311.yml diff --git a/.ci/39.yml b/ci/312.yml similarity index 97% rename from .ci/39.yml rename to ci/312.yml index 8866c7e6..2830709f 100644 --- a/.ci/39.yml +++ b/ci/312.yml @@ -2,7 +2,7 @@ name: test channels: - conda-forge dependencies: - - python=3.9 + - python=3.12 - deprecation - geopandas>=0.9 - joblib From 9cb0a826d8c7c0c379d32360ea2d8f07731ab235 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Wed, 6 Mar 2024 13:06:30 -0800 Subject: [PATCH 02/11] leading . --- .github/workflows/unittests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 458aeea6..c02838bc 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -22,11 +22,11 @@ jobs: - ci/311.yml - ci/312.yml include: - - environment-file: .ci/311.yml + - environment-file: ci/311.yml os: macos-latest - - environment-file: .ci/311.yml + - environment-file: ci/311.yml os: macos-14 # Apple Silicon - - environment-file: .ci/311.yml + - environment-file: ci/311.yml os: windows-latest defaults: run: @@ -40,7 +40,7 @@ jobs: with: environment-file: ${{ matrix.environment-file }} micromamba-version: 'latest' - + - name: Test segregation run: | coverage run -m pytest \ From a4b93e81afc31eb30aeab6fc697667b6a395532f Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 19:29:12 -0400 Subject: [PATCH 03/11] Update unittests.yml add manual trigger --- .github/workflows/unittests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 7d8f2a2b..84a042f9 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -8,6 +8,12 @@ - '*' schedule: - cron: '59 23 * * *' + workflow_dispatch: + inputs: + version: + description: Manual Unittest Run + default: test + required: false jobs: unittests: From 5df9099bdac4f705b676eb16441e8e771f9b2e03 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 20:19:14 -0400 Subject: [PATCH 04/11] matching job name --- .github/workflows/unittests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 64fa5155..1410667f 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,4 +1,4 @@ - name: Unit Tests + name: Tests on: push: branches: @@ -25,7 +25,7 @@ on: - cron: "0 0 * * 1,4" jobs: - Test: + Tests: name: ${{ matrix.os }}, ${{ matrix.environment-file }} runs-on: ${{ matrix.os }} strategy: From 8a14bd401d46aa620c634742542daa46a8da1f5e Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 20:22:01 -0400 Subject: [PATCH 05/11] correct yml syntax [1] --- .github/workflows/unittests.yml | 135 +++++++++++++++----------------- 1 file changed, 63 insertions(+), 72 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 1410667f..b5bdb8d1 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,13 +1,13 @@ name: Tests + on: push: - branches: - - '*' + branches: [main] pull_request: branches: - '*' schedule: - - cron: '59 23 * * *' + - cron: "0 0 * * 1,4" workflow_dispatch: inputs: version: @@ -15,72 +15,63 @@ default: test required: false -on: - push: - branches: [main] - pull_request: - branches: - - "*" - schedule: - - cron: "0 0 * * 1,4" - -jobs: - Tests: - name: ${{ matrix.os }}, ${{ matrix.environment-file }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - environment-file: - - ci/310.yml - - ci/311.yml - - ci/312.yml - include: - - environment-file: ci/311.yml - os: macos-latest - - environment-file: ci/311.yml - os: macos-14 # Apple Silicon - - environment-file: ci/311.yml - os: windows-latest - defaults: - run: - shell: bash -l {0} - - steps: - - uses: actions/checkout@v4 - - - name: setup micromamba - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: ${{ matrix.environment-file }} - micromamba-version: 'latest' - - - name: Test segregation - run: | - coverage run -m pytest \ - -v \ - -r a \ - -n auto \ - --color yes \ - --cov segregation \ - --cov-append \ - --cov-report term-missing \ - --cov-report xml \ - segregation - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - name: segregation-codecov - - - name: Generate and publish the report - if: | - failure() - && steps.status.outcome == 'failure' - && github.event_name == 'schedule' - && github.repository_owner == 'oturns' - uses: xarray-contrib/issue-from-pytest-log@v1 - with: - log-path: pytest-log.jsonl + jobs: + Tests: + name: ${{ matrix.os }}, ${{ matrix.environment-file }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + environment-file: + - ci/310.yml + - ci/311.yml + - ci/312.yml + include: + - environment-file: ci/311.yml + os: macos-latest + - environment-file: ci/311.yml + os: macos-14 # Apple Silicon + - environment-file: ci/311.yml + os: windows-latest + defaults: + run: + shell: bash -l {0} + + steps: + - uses: actions/checkout@v4 + + - name: setup micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ${{ matrix.environment-file }} + micromamba-version: 'latest' + + - name: Test segregation + run: | + coverage run -m pytest \ + -v \ + -r a \ + -n auto \ + --color yes \ + --cov segregation \ + --cov-append \ + --cov-report term-missing \ + --cov-report xml \ + segregation + - name: codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + name: segregation-codecov + + - name: Generate and publish the report + if: | + failure() + && steps.status.outcome == 'failure' + && github.event_name == 'schedule' + && github.repository_owner == 'oturns' + uses: xarray-contrib/issue-from-pytest-log@v1 + with: + log-path: pytest-log.jsonl From c64dec737b07dbbcfe893a4f3da5012442972997 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Sat, 16 Mar 2024 17:32:32 -0700 Subject: [PATCH 06/11] oturns-->pysal --- .github/workflows/unittests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index b5bdb8d1..a50a853f 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -71,7 +71,7 @@ failure() && steps.status.outcome == 'failure' && github.event_name == 'schedule' - && github.repository_owner == 'oturns' + && github.repository_owner == 'pysal' uses: xarray-contrib/issue-from-pytest-log@v1 with: log-path: pytest-log.jsonl From e4e01fdfe04f9770247dbaa45cd9c3ad54b42912 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 21:52:57 -0400 Subject: [PATCH 07/11] update codecove action version --- .github/workflows/unittests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index b5bdb8d1..c4c18024 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -60,7 +60,7 @@ --cov-report xml \ segregation - name: codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml From 6c21de784e12c554219cf9667f0b6ee5b9eb4d74 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 21:56:31 -0400 Subject: [PATCH 08/11] need pytest-xdist for multicore testing --- ci/310.yml | 1 + ci/311.yml | 1 + ci/312.yml | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/310.yml b/ci/310.yml index 5bc24a64..527b614f 100644 --- a/ci/310.yml +++ b/ci/310.yml @@ -27,4 +27,5 @@ dependencies: - pytest - pytest-mpl - pytest-cov + - pytest-xdist - twine diff --git a/ci/311.yml b/ci/311.yml index 39c964f8..9580f08e 100644 --- a/ci/311.yml +++ b/ci/311.yml @@ -27,5 +27,6 @@ dependencies: - pytest - pytest-mpl - pytest-cov + - pytest-xdist - twine diff --git a/ci/312.yml b/ci/312.yml index 2830709f..bcb4f757 100644 --- a/ci/312.yml +++ b/ci/312.yml @@ -27,6 +27,7 @@ dependencies: - pytest - pytest-mpl - pytest-cov + - pytest-xdist - twine # docs @@ -41,4 +42,4 @@ dependencies: - sphinxcontrib-bibtex - sphinx_bootstrap_theme - watermark - - black \ No newline at end of file + - black From a155ecc0a11c40ccdb3e94803ac3122ea9fe57e6 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 22:01:11 -0400 Subject: [PATCH 09/11] pytest cmd syntax --- .github/workflows/unittests.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 2e1b773e..13367730 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -49,16 +49,16 @@ - name: Test segregation run: | - coverage run -m pytest \ - -v \ - -r a \ - -n auto \ - --color yes \ - --cov segregation \ - --cov-append \ - --cov-report term-missing \ - --cov-report xml \ - segregation + pytest \ + segregation \ + -v \ + -r a \ + --color yes \ + --cov segregation \ + --cov-append \ + --cov-report term-missing \ + --cov-report xml \ + - name: codecov uses: codecov/codecov-action@v4 with: From b1f6bc02460eb69c66df4563738e6048fd871c58 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 22:06:50 -0400 Subject: [PATCH 10/11] maybe sing vs. multi core? --- .github/workflows/unittests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 13367730..f94995c7 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -52,6 +52,7 @@ pytest \ segregation \ -v \ + -n auto \ -r a \ --color yes \ --cov segregation \ From ed365772b1cf979ed609cb6434a3b2c6ad7fd685 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 16 Mar 2024 22:11:15 -0400 Subject: [PATCH 11/11] single core succeeds, multi does not --- .github/workflows/unittests.yml | 1 - ci/310.yml | 1 - ci/311.yml | 1 - ci/312.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index f94995c7..13367730 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -52,7 +52,6 @@ pytest \ segregation \ -v \ - -n auto \ -r a \ --color yes \ --cov segregation \ diff --git a/ci/310.yml b/ci/310.yml index 527b614f..5bc24a64 100644 --- a/ci/310.yml +++ b/ci/310.yml @@ -27,5 +27,4 @@ dependencies: - pytest - pytest-mpl - pytest-cov - - pytest-xdist - twine diff --git a/ci/311.yml b/ci/311.yml index 9580f08e..39c964f8 100644 --- a/ci/311.yml +++ b/ci/311.yml @@ -27,6 +27,5 @@ dependencies: - pytest - pytest-mpl - pytest-cov - - pytest-xdist - twine diff --git a/ci/312.yml b/ci/312.yml index bcb4f757..6f03c286 100644 --- a/ci/312.yml +++ b/ci/312.yml @@ -27,7 +27,6 @@ dependencies: - pytest - pytest-mpl - pytest-cov - - pytest-xdist - twine # docs