From 9a6ac6dc72bbfdcbb437f7e4d9b139745ab7502c Mon Sep 17 00:00:00 2001 From: Sean Freeman Date: Fri, 1 Nov 2024 14:18:11 -0500 Subject: [PATCH 1/5] bring CI fixes from append tracking --- .github/workflows/check_notebooks.yml | 21 ++++++-------------- .github/workflows/codecov-CI.yml | 20 ++++++++----------- .github/workflows/pylint.yml | 23 ++++++++++------------ environment-ci.yml | 3 +++ environment-examples.yml | 28 +++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 40 deletions(-) create mode 100644 environment-examples.yml diff --git a/.github/workflows/check_notebooks.yml b/.github/workflows/check_notebooks.yml index ea7a3bfa..0ed64757 100644 --- a/.github/workflows/check_notebooks.yml +++ b/.github/workflows/check_notebooks.yml @@ -9,22 +9,13 @@ jobs: steps: - name: check out repository code uses: actions/checkout@v3 - - name: set up conda environment - uses: conda-incubator/setup-miniconda@v2 + - name: set up mamba environment + uses: mamba-org/setup-micromamba@v1 with: - miniforge-version: latest - miniforge-variant: mambaforge - channel-priority: strict - channels: conda-forge - show-channel-urls: true - use-only-tar-bz2: true - auto-update-conda: true - auto-activate-base: false - activate-environment: notebook-env - - name: Install tobac dependencies - run: | - mamba install -c conda-forge --yes ffmpeg gcc jupyter pytables - mamba install -c conda-forge --yes --file example_requirements.txt + environment-file: environment-examples.yml + generate-run-shell: true + cache-environment: true + cache-downloads: true - name: Install tobac run: | pip install . diff --git a/.github/workflows/codecov-CI.yml b/.github/workflows/codecov-CI.yml index c20c96c5..f704ab85 100644 --- a/.github/workflows/codecov-CI.yml +++ b/.github/workflows/codecov-CI.yml @@ -7,24 +7,20 @@ jobs: runs-on: ubuntu-latest env: OS: ubuntu-latest - PYTHON: "3.9" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Similar to MetPy install-conda action - name: Set up conda - uses: conda-incubator/setup-miniconda@v2 + uses: mamba-org/setup-micromamba@v1 with: - miniforge-version: latest - miniforge-variant: mambaforge - channel-priority: strict - channels: conda-forge - show-channel-urls: true - use-only-tar-bz2: true + environment-file: environment-ci.yml + generate-run-shell: true + cache-environment: true + cache-downloads: true - - name: Install dependencies and generate report - shell: bash -l {0} + - name: Generate report + shell: micromamba-shell {0} run: - mamba install --quiet --yes --file requirements.txt coverage pytest-cov && python -m coverage run -m pytest --cov=./ --cov-report=xml - name: Upload Coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 0519ed42..dc383b71 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -14,21 +14,18 @@ jobs: shell: bash -l {0} steps: - name: Check out Git repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Set up conda - uses: conda-incubator/setup-miniconda@v2 + - name: Set up mamba + uses: mamba-org/setup-micromamba@v1 with: - miniforge-version: latest - miniforge-variant: mambaforge - channel-priority: strict - channels: conda-forge - show-channel-urls: true - use-only-tar-bz2: true + environment-file: environment-ci.yml + generate-run-shell: true + cache-environment: true + cache-downloads: true - - name: Install tobac and pylint + - name: Install tobac run: | - mamba install --yes pylint pip install . - name: Store the PR branch @@ -37,7 +34,7 @@ jobs: id: git - name: Checkout RC branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} @@ -47,7 +44,7 @@ jobs: id: main_score - name: Checkout PR branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: "${{ steps.git.outputs.SHA }}" diff --git a/environment-ci.yml b/environment-ci.yml index 964e7155..42fe24ec 100644 --- a/environment-ci.yml +++ b/environment-ci.yml @@ -15,3 +15,6 @@ dependencies: - pytest - typing_extensions - black + - coverage + - pytest-cov + - pylint diff --git a/environment-examples.yml b/environment-examples.yml new file mode 100644 index 00000000..c8999a3c --- /dev/null +++ b/environment-examples.yml @@ -0,0 +1,28 @@ +name: tobac-dev +channels: + - conda-forge +dependencies: + - numpy + - scipy + - scikit-image + - scikit-learn + - pandas + - matplotlib + - iris + - xarray + - cartopy + - trackpy>=0.6.1 + - pytest + - typing_extensions + - black + - jupyter + - notebook + - pytables + - s3fs + - arm_pyart + - seaborn + - h5netcdf + - typing_extensions + - rioxarray + - numba + - dask \ No newline at end of file From 57a77c9bf77391f6547b815e5b76027cc2e390f4 Mon Sep 17 00:00:00 2001 From: Sean Freeman Date: Fri, 1 Nov 2024 14:36:37 -0500 Subject: [PATCH 2/5] add xarray pin for example notebooks --- environment-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment-examples.yml b/environment-examples.yml index c8999a3c..db82fc7c 100644 --- a/environment-examples.yml +++ b/environment-examples.yml @@ -9,7 +9,7 @@ dependencies: - pandas - matplotlib - iris - - xarray + - xarray<2024.10.0 - cartopy - trackpy>=0.6.1 - pytest From eb4cd3a4d5d4aa3a04a8fb93553c56528b1ca095 Mon Sep 17 00:00:00 2001 From: Sean Freeman Date: Fri, 1 Nov 2024 14:38:44 -0500 Subject: [PATCH 3/5] attempt to fix pylint CI --- .github/workflows/pylint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index dc383b71..04e98424 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -14,7 +14,7 @@ jobs: shell: bash -l {0} steps: - name: Check out Git repository - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Set up mamba uses: mamba-org/setup-micromamba@v1 @@ -34,7 +34,7 @@ jobs: id: git - name: Checkout RC branch - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: ref: ${{ github.base_ref }} @@ -44,7 +44,7 @@ jobs: id: main_score - name: Checkout PR branch - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: ref: "${{ steps.git.outputs.SHA }}" From dafc02661ed58bfa2e67d4935a4b2a17bbc7608f Mon Sep 17 00:00:00 2001 From: Sean Freeman Date: Fri, 1 Nov 2024 14:41:02 -0500 Subject: [PATCH 4/5] more changes to pylint workflow. --- .github/workflows/pylint.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 04e98424..1fb1318b 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,29 +7,27 @@ permissions: pull-requests: write jobs: - build: + lint-workflow: runs-on: ubuntu-latest defaults: run: shell: bash -l {0} steps: - name: Check out Git repository - uses: actions/checkout@v3 - - - name: Set up mamba + uses: actions/checkout@v4 + - name: Set up mamba environment uses: mamba-org/setup-micromamba@v1 with: environment-file: environment-ci.yml generate-run-shell: true cache-environment: true cache-downloads: true - - name: Install tobac - run: | + run: pip install . - name: Store the PR branch - run: | + run: echo "SHA=$(git rev-parse "$GITHUB_SHA")" >> $GITHUB_OUTPUT id: git @@ -39,7 +37,7 @@ jobs: ref: ${{ github.base_ref }} - name: Get pylint score of RC branch - run: | + run: pylint tobac --disable=C --exit-zero id: main_score @@ -49,7 +47,7 @@ jobs: ref: "${{ steps.git.outputs.SHA }}" - name: Get pylint score of PR branch - run: | + run: # use shell script to save only tail of output OUTPUT_PART=$(pylint tobac --disable=C --exit-zero | tail -n 2) # but post entire output in the action details From 203e4fd1bb952b740d000c6f0fd826f89e36216f Mon Sep 17 00:00:00 2001 From: Sean Freeman Date: Fri, 1 Nov 2024 14:49:34 -0500 Subject: [PATCH 5/5] add ffmpeg to example notebook requirements --- environment-examples.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environment-examples.yml b/environment-examples.yml index db82fc7c..47426606 100644 --- a/environment-examples.yml +++ b/environment-examples.yml @@ -25,4 +25,5 @@ dependencies: - typing_extensions - rioxarray - numba - - dask \ No newline at end of file + - dask + - ffmpeg \ No newline at end of file