Skip to content

Commit

Permalink
Merge branch 'main' into use-src
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/publish-mastodon.yml
#	CHANGELOG.rst
  • Loading branch information
Zeitsperre committed Nov 7, 2024
2 parents af8eb5c + 4198e8b commit 85cdd3f
Show file tree
Hide file tree
Showing 28 changed files with 227 additions and 133 deletions.
4 changes: 2 additions & 2 deletions .github/publish-mastodon-template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
New #xclim release: {{ .version }} 🎉
New #xclim release: {{ .tag }} 🎉

Latest source code available at: https://github.com/Ouranosinc/xclim/releases/tag/{{ .version }}
Latest source code available at: {{ .url }}
Check out the docs for more information: https://xclim.readthedocs.io/en/stable/

8 changes: 5 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- .*
- .github/*/*.md
- .github/*/*.yml
- .github/*.md
- .github/*.yml
- CHANGELOG.rst
- CI/*.in
- CI/*.txt
Expand Down Expand Up @@ -51,15 +53,15 @@ jobs:
app-id: ${{ secrets.OURANOS_HELPER_BOT_ID }}
private-key: ${{ secrets.OURANOS_HELPER_BOT_KEY }}
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.token_generator.outputs.token }}
- name: Set up Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
with:
gpg_private_key: ${{ secrets.OURANOS_HELPER_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.OURANOS_HELPER_BOT_GPG_PRIVATE_KEY_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cache-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
objects.githubusercontent.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Cleanup
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
pypi.org:443
uploads.github.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1245696032ecf7d39f87d54daa406e22ddf769a8
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
github.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Dependency Review
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ jobs:
github.com:443
pypi.org:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"
cache: 'pip'
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment Caching
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ matrix.testdata-cache }}
Expand Down Expand Up @@ -95,17 +95,17 @@ jobs:
pypi.org:443
raw.githubusercontent.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.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@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ matrix.testdata-cache }}
Expand Down Expand Up @@ -193,14 +193,14 @@ jobs:
pypi.org:443
raw.githubusercontent.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Eigen3 (SBCK)
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install libeigen3-dev
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -210,7 +210,7 @@ jobs:
- name: Environment Caching
# if prefetch is not in tox-env
if: contains(matrix.tox-env, 'prefetch') == false
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ matrix.testdata-cache }}
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
raw.githubusercontent.com:443
repo.anaconda.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0
with:
Expand All @@ -280,7 +280,7 @@ jobs:
run: |
echo "micromamba: $(micromamba --version)"
- name: Test Data Caching
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ matrix.testdata-cache }}
Expand Down Expand Up @@ -329,6 +329,6 @@ jobs:
disable-sudo: true
egress-policy: audit
- name: Coveralls Finished
uses: coverallsapp/github-action@4cdef0b2dbe0c9aa26bed48edb868db738625e79 # v2.3.3
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
with:
parallel-finished: true
32 changes: 5 additions & 27 deletions .github/workflows/publish-mastodon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@ name: Publish Release Announcement to Mastodon
on:
release:
types:
- published
workflow_dispatch:
inputs:
version-tag:
description: 'Version to announce'
required: true
type: string
dry-run:
description: 'Dry run'
default: true
type: boolean
- released

permissions:
contents: read
Expand All @@ -35,25 +25,13 @@ jobs:
github.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Current Version
if: ${{ !github.event.inputs.version-tag }}
run: |
CURRENT_VERSION="$(grep -E '__version__' xclim/__init__.py | cut -d ' ' -f3)"
echo "version=v${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Set Version from Input
if: ${{ github.event.inputs.version-tag }}
run: |
echo "version=${{ github.event.inputs.version-tag }}" >> $GITHUB_ENV
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Get Release Description
if: ${{ !endsWith(env.current_version, '-dev') }}
id: get_release_description
run: |
# Fetch the release information using the GitHub API
RELEASE_INFO=$(curl -sH "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.version }}")
"https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.event.release.tag_name }}")
# Extract the release description from the response
RELEASE_DESCRIPTION=$(echo "$RELEASE_INFO" | jq -r .body)
Expand All @@ -72,14 +50,14 @@ jobs:
with:
template: .github/publish-mastodon-template.md
vars: |
version: ${{ env.version }}
tag: ${{ github.event.release.tag_name }}
url: https://github.com/Ouranosinc/xclim/releases/tag/${{ github.event.release.tag_name }}
- name: Message Preview
run: |
echo "${{ steps.render_template.outputs.result }}${{ env.contributors }}"
- name: Send toot to Mastodon
if: ${{ github.event.inputs.dry-run != 'true' || github.event_name == 'release' }}
uses: cbrgm/mastodon-github-action@b26d62619432b20c2129edd86f07f7ede9797fc9 # v2.1.9
with:
url: ${{ secrets.MASTODON_URL }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443
ruf-repo-cdn.sigstore.dev:443
upload.pypi.org:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"
- name: Install CI libraries
Expand All @@ -40,4 +41,4 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa # v1.11.0
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443
ruf-repo-cdn.sigstore.dev:443
test.pypi.org:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.x"
- name: Install CI libraries
Expand All @@ -40,7 +41,7 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa # v1.11.0
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
2 changes: 1 addition & 1 deletion .github/workflows/testdata-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
api.github.com:443
github.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Find xclim-testdata Tag and CI Testing Branch
run: |
XCLIM_TESTDATA_TAG="$( \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
raw.githubusercontent.com:443
repo.anaconda.com:443
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
xclim show_version_info
python -m pip check || true
- name: Test Data Caching
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
${{ matrix.testdata-cache }}
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: ['--py39-plus']
Expand Down Expand Up @@ -37,7 +37,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.2
hooks:
- id: ruff
args: [ '--fix', '--show-fixes' ]
Expand Down Expand Up @@ -65,7 +65,7 @@ repos:
- id: nbqa-black
additional_dependencies: [ 'black==24.10.0' ]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.0
hooks:
- id: nbstripout
files: '.ipynb'
Expand Down Expand Up @@ -99,7 +99,7 @@ repos:
- id: codespell
additional_dependencies: [ 'tomli' ]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.1
rev: v8.21.2
hooks:
- id: gitleaks
- repo: https://github.com/python-jsonschema/check-jsonschema
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ Internal changes
* `xclim` now uses a `src` layout for the codebase. Structure-dependent functions, documentation, and build commands have been adapted to reflect these changes. (:pull:`1971`).
* Added a more robust `yamllint` configuration to ensure that all YAML files are linted consistently. (:pull:`1971`).

v0.53.2 (2024-10-31)
--------------------
Contributors to this version: Éric Dupuis (:user:`coxipi`), Pascal Bourgault (:user:`aulemahal`), Trevor James Smith (:user:`Zeitsperre`).

Breaking changes
^^^^^^^^^^^^^^^^
* Due to a regression affecting symmetry of ``polyfit`` and ``polyval`` in `xarray`, `xclim` now requires `xarray>=2023.11.0,!=2024.10.0` (see: `pydata/xarray PR/9691 <https://github.com/pydata/xarray/pull/9691>`_. (:pull:`1978`).

Bug fixes
^^^^^^^^^
* Fixed a bug where the units could be changed before a conversion of the magnitudes could occur. Conversion of units for multivariate ``DataArray`` is now properly handled in `sdba.TrainAdjust` and `sdba.Adjust`. (:pull:`1972`).
* Fixed a units formatting bug with indicators that output "delta" Celsius degrees. (:pull:`1973`).
* Corrected the ``"choices"`` of parameter ``op`` in the docstring of ``frost_free_spell_max_length``. (:pull:`1977`).
* Reorganised how ``Indicator`` subclasses can added arguments to the call signature. Injecting such arguments now works. For xclim's subclasses, this bug only affected the ``indexer`` argument of indicators subclassing ``xc.core.indicator.IndexingIndicator``. (:pull:`1981`).
* All-nan slices are now treated correctly in method `ExtremeValues`. (:issue:`1982`, :pull:`1983`).

v0.53.1 (2024-10-21)
--------------------
Contributors to this version: Trevor James Smith (:user:`Zeitsperre`).
Expand Down
8 changes: 4 additions & 4 deletions CI/requirements_ci.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bump-my-version==0.28.0
bump-my-version==0.28.1
deptry==0.20.0
flit==3.9.0
pip==24.2.0
flit==3.10.1
pip==24.3.1
pylint==3.3.1
tox==4.23.0
tox==4.23.2
tox-gh==1.4.4
Loading

0 comments on commit 85cdd3f

Please sign in to comment.