Skip to content

Commit

Permalink
Merge branch 'main' into hydrotel_met
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre authored Sep 30, 2024
2 parents 7980416 + 7c7173d commit 4bb65ba
Show file tree
Hide file tree
Showing 30 changed files with 751 additions and 249 deletions.
8 changes: 4 additions & 4 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "1df7f86aff75906cce17571a86e59e64f692f208",
"commit": "1d9ee5f08d3e8e4f78a4aabb75e2ce4eff8750bf",
"checkout": null,
"context": {
"cookiecutter": {
"full_name": "Thomas-Charles Fortier Filion",
"email": "tcff_hydro@outlook.com",
"github_username": "TC-FF",
"github_username": "hydrologie",
"project_name": "xHydro",
"project_slug": "xhydro",
"project_short_description": "Hydrological analysis library built with xarray.",
"pypi_username": "TC-FF",
"version": "0.3.7-dev.4",
"version": "0.3.7-dev.7",
"use_pytest": "y",
"use_black": "y",
"use_conda": "y",
Expand All @@ -22,7 +22,7 @@
"create_author_file": "y",
"open_source_license": "Apache Software License 2.0",
"generated_with_cruft": "y",
"__gh_slug": "https://github.com/TC-FF/xHydro",
"__gh_slug": "https://github.com/hydrologie/xhydro",
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage"
}
},
Expand Down
32 changes: 0 additions & 32 deletions .github/deactivated/actions-versions-updater.yml

This file was deleted.

18 changes: 15 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: github-actions
directory: /.github/workflows/
directory: /.github/workflows
schedule:
interval: monthly
open-pull-requests-limit: 10
groups:
actions:
patterns:
- "*"

- package-ecosystem: pip
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
groups:
ci:
patterns:
- "CI/*"
python:
patterns:
- "pyproject.toml"
44 changes: 26 additions & 18 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# This workflow requires a personal access token named `BUMP_VERSION_TOKEN` with the following privileges:
# - Contents: Read and Write
# - Metadata: Read-Only
# - Pull Requests: Read and Write

name: "Bump Patch Version"

on:
Expand All @@ -12,7 +7,8 @@ on:
paths-ignore:
- .cruft.json
- .editorconfig
- .github/**.yml
- .github/*/*.md
- .github/*/*.yml
- .gitignore
- .pre-commit-config.yaml
- .readthedocs.yml
Expand Down Expand Up @@ -42,41 +38,52 @@ permissions:

jobs:
bump_patch_version:
name: Bumpversion Patch
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout Repository (no persist-credentials)
- name: Generate App Token
id: token_generator
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.HYDROLOGIE_HELPER_BOT_ID }}
private-key: ${{ secrets.HYDROLOGIE_HELPER_BOT_KEY }}
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
fetch-depth: 0
token: ${{ steps.token_generator.outputs.token }}
- name: Set up Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.x"
- name: Config Commit Bot
run: |
git config --local user.email "bumpversion[bot]@hydrologie.com"
git config --local user.name "bumpversion[bot]"
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.HYDROLOGIE_HELPER_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.HYDROLOGIE_HELPER_BOT_GPG_PRIVATE_KEY_PASSWORD }}
git_user_signingkey: true
git_commit_gpgsign: true
trust_level: 5
- name: Current Version
run: |
CURRENT_VERSION="$(grep -E '__version__' src/xhydro/__init__.py | cut -d ' ' -f3)"
echo "current_version=${CURRENT_VERSION}"
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Conditional Bump Version
- name: Conditional Bump
run: |
if [[ ${{ env.CURRENT_VERSION }} =~ -dev(\.\d+)? ]]; then
echo "Development version (ends in 'dev(\.\d+)?'), bumping 'build' version"
Expand All @@ -85,10 +92,11 @@ jobs:
echo "Version is stable, bumping 'patch' version"
bump-my-version bump patch
fi
bump-my-version show-bump
NEW_VERSION="$(grep -E '__version__' src/xhydro/__init__.py | cut -d ' ' -f3)"
echo "new_version=${NEW_VERSION}"
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
- name: Push Changes
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0
with:
force: false
github_token: ${{ secrets.BUMP_VERSION_TOKEN }}
branch: ${{ github.ref }}
2 changes: 1 addition & 1 deletion .github/workflows/cache-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
actions: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/first-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand Down Expand Up @@ -56,5 +56,5 @@ jobs:
It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the \`AUTHORS.rst\` and \`.zenodo.json\`:
- [ ] The relevant author information has been added to \`AUTHORS.rst\` and \`.zenodo.json\`.
Please make sure you've read our [contributing guide](CONTRIBUTING.rst). We look forward to reviewing your Pull Request shortly ✨`
Please make sure you've read our [contributing guide](https://github.com/hydrologie/xhydro/blob/main/CONTRIBUTING.rst). We look forward to reviewing your Pull Request shortly ✨`
})
4 changes: 2 additions & 2 deletions .github/workflows/label-on-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -51,7 +51,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand Down
56 changes: 30 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- "3.x"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -59,29 +59,35 @@ jobs:
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment Caching
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .tox
key: ${{ matrix.os }}-Python${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
- name: Run linting suite
run: |
python -m tox -e lint
test-preliminary:
name: Preliminary Tests (Python${{ matrix.python-version }})
name: Preliminary Tests (Python${{ matrix.python-version }}, ${{ matrix.os }})
needs: lint
if: |
(github.event_name == 'pull_request') && !contains(github.event.pull_request.labels.*.name, 'approved')
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- python-version: "3.10"
os: [ 'ubuntu-latest' ]
python-version: [ "3.10" ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand Down Expand Up @@ -125,23 +131,24 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-conda:
name: Test with Python${{ matrix.python-version }} (Anaconda)
name: Test with Python${{ matrix.python-version }} (Anaconda, ${{ matrix.os }})
needs: lint
if: |
contains(github.event.pull_request.labels.*.name, 'approved') ||
(github.event.review.state == 'approved') ||
(github.event_name == 'push')
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
python-version: [ "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -165,6 +172,7 @@ jobs:
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0
with:
cache-downloads: true
cache-environment: true
environment-file: environment-dev.yml
create-args: >-
mamba
Expand Down Expand Up @@ -195,23 +203,24 @@ jobs:
COVERALLS_SERVICE_NAME: github

test-notebooks:
name: Test Notebooks
name: Test Notebooks (Python${{ matrix.python-version }}, ${{ matrix.os }})
needs: lint
if: |
contains(github.event.pull_request.labels.*.name, 'notebooks') ||
contains(github.event.pull_request.labels.*.name, 'approved') ||
(github.event.review.state == 'approved') ||
(github.event_name == 'push')
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
python-version: [ "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -234,6 +243,7 @@ jobs:
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-environment: true
environment-file: environment-dev.yml
create-args: >-
mamba
Expand Down Expand Up @@ -308,19 +318,13 @@ jobs:
- test-conda
- test-notebooks
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
sparse-checkout: |
CI/requirements_ci.txt
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Coveralls finished
run: |
python -m coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
disable-sudo: true
egress-policy: audit
- name: Coveralls Finished
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0
with:
parallel-finished: true
Loading

0 comments on commit 4bb65ba

Please sign in to comment.