Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/auto-accept-ci-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
permission-contents: write
permission-pull-requests: write

- name: Stop workflow if not minor update or patch update
id: skip-condition
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cache_cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Cleanup
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/first_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,29 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.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@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
.tox
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-lint-${{ env.ESGF_TEST_DATA_VERSION }}

- name: Run linting suite
run: |
python -m tox -e lint
Expand All @@ -71,22 +76,27 @@ jobs:
with:
disable-sudo: false
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install HDF5 (Linux)
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev

- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt

- name: Environment Caching
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
Expand All @@ -95,6 +105,7 @@ jobs:
~/.cache/xclim-testdata
.tox
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-Python${{ matrix.python-version }}-${{ env.ESGF_TEST_DATA_VERSION }}

- name: Test with tox
run: |
python -m tox
Expand All @@ -112,7 +123,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.11", "3.12", "3.13" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
defaults:
run:
shell: bash -l {0}
Expand All @@ -122,10 +133,12 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
Expand All @@ -134,24 +147,28 @@ jobs:
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
pytest-timeout

- name: Install CLISOPS
run: |
python -m pip install --no-user --no-deps --editable .

- name: Test Data Caching
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
~/.cache/mini-esgf-data
~/.cache/xclim-testdata
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-conda-Python${{ matrix.python-version }}-${{ env.ESGF_TEST_DATA_VERSION }}

- name: Check versions
run: |
micromamba list
python -m pip check || true

- name: Test with conda
run: |
python -m pytest -m "not slow" --timeout=300 --numprocesses=logical --durations=10 --cov=clisops --cov-report=lcov
python -m pytest -m "not slow" --numprocesses=logical --durations=10 --cov=clisops --cov-report=lcov

- name: Report Coverage
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
Expand All @@ -170,6 +187,7 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- name: Coveralls Finished
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Create Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
env:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish-pypi-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,24 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "${{ matrix.python-version }}"

- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt

- name: Build a binary wheel and a source tarball
run: |
python -m flit build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
5 changes: 5 additions & 0 deletions .github/workflows/tag-testpypi-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,25 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "${{ matrix.python-version }}"

- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt

- name: Build a binary wheel and a source tarball
run: |
python -m flit build

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ jobs:
with:
disable-sudo: true
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
persist-credentials: false

- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
Expand All @@ -56,21 +58,26 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}
pytest-reportlog

- name: Install CLISOPS
run: |
python -m pip install --no-deps --no-user --editable .

- name: Install upstream versions
run: |
python -m pip install -r CI/requirements_upstream.txt

- name: Check versions
run: |
micromamba list
python -m pip check || true

- name: Run Tests
if: success()
id: status
run: |
python -m pytest --durations=10 --cov=clisops --cov-report=term-missing --report-log output-${{ matrix.python-version }}-log.jsonl

- name: Generate and publish the report
if: |
failure()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ htmlcov/
.coverage.*
.cache
nosetests.xml
coverage.xml
coverage.*
*.cover
.hypothesis/
.pytest_cache/
Expand Down
18 changes: 11 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: no-commit-to-branch
args: [ '--branch', 'main' ]
- id: name-tests-test
args: [ '--pytest-test-first' ]
- id: no-commit-to-branch
args: [ '--branch', 'main' ]
- id: pretty-format-json
args: [ '--autofix', '--no-ensure-ascii', '--no-sort-keys' ]
exclude: .ipynb
- id: trailing-whitespace
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.4
Expand All @@ -32,7 +36,7 @@ repos:
- id: yamllint
args: [ '--config-file=.yamllint.yaml' ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.9
rev: v0.15.15
hooks:
- id: ruff-check
args: [ '--fix', '--show-fixes' ]
Expand Down Expand Up @@ -69,11 +73,11 @@ repos:
- id: numpydoc-validation
exclude: ^docs/|^tests/
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
rev: v8.30.1
hooks:
- id: gitleaks
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.1
rev: 0.37.2
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ sphinx:

# Build configuration
build:
os: ubuntu-24.04
os: "ubuntu-26.04"
tools:
python: "mambaforge-23.11"
python: "miniforge3-25.11"
jobs:
post_create_environment:
- mamba install --quiet --name ${READTHEDOCS_VERSION} -c conda-forge "python>=3.12,<3.13" "psy-maps>=1.5.0"
Expand Down
19 changes: 10 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,35 @@ Ready to contribute? Here's how to set up `clisops` for local development.
Now you can make your changes locally!

#.
When you are done making changes, check that you verify your changes with `flake8` and `black` and run the tests, including testing other Python versions with `tox`:
When you are done making changes, check that you verify your changes with `deptry`, `flake8`, and `ruff` and run the tests, including testing other Python versions with `tox`:

.. code-block:: shell

# For virtualenv environments:
$ pip install flake8 black pytest pytest-loguru tox
$ pip install flake8 ruff deptry pytest pytest-loguru tox

# For Anaconda/Miniconda environments:
$ conda install -c conda-forge flake8 black pytest pytest-loguru tox

$ flake8 clisops tests
$ black clisops tests
$ ruff check clisops tests
$ flake8 --config=.flake8 clisops tests
$ deptry .
$ pytest
$ tox

#.
Before committing your changes, we ask that you install `pre-commit` in your virtualenv. `Pre-commit` runs git hooks that ensure that your code resembles that of the project and catches and corrects any small errors or inconsistencies when you `git commit`:
Before committing your changes, we ask that you install `prek` in your virtualenv. `prek` runs git hooks that ensure that your code resembles that of the project and catches and corrects any small errors or inconsistencies when you `git commit`:

.. code-block:: shell

# For virtualenv environments:
$ pip install pre-commit
$ pip install prek

# For Anaconda/Miniconda environments:
$ conda install -c conda-forge pre-commit
$ conda install -c conda-forge prek

$ pre-commit install
$ pre-commit run --all-files
$ prek install
$ prek run --all-files

#.
Commit your changes and push your branch to GitHub:
Expand Down
Loading