diff --git a/.cruft.json b/.cruft.json index 36aa7ed..39985d5 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/Ouranosinc/cookiecutter-pypackage", - "commit": "b9dc57245a77dd3c465a444d4943884ee92157ea", + "commit": "1d9ee5f08d3e8e4f78a4aabb75e2ce4eff8750bf", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 56265d3..dbeb479 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 864f45a..07ef847 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,6 +40,7 @@ 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 @@ -48,16 +49,18 @@ jobs: python -m tox -e lint test-pypi: - name: Test with Python${{ matrix.python-version }} (tox) + name: Test with Python${{ matrix.python-version }} (tox, ${{ matrix.os }}) needs: lint - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ 'ubuntu-latest' ] python-version: - "3.9" - "3.10" - "3.11" - "3.12" +# - "3.13" steps: - name: Harden Runner uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 @@ -69,6 +72,7 @@ jobs: uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: ${{ matrix.python-version }} + cache: "pip" - name: Install GDAL run: | sudo apt-get update @@ -76,6 +80,11 @@ jobs: - 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: Test with tox run: tox env: @@ -85,11 +94,12 @@ jobs: COVERALLS_SERVICE_NAME: github test-conda: - name: Test with Python${{ matrix.python-version }} (Anaconda) + name: Test with Python${{ matrix.python-version }} (Anaconda, ${{ matrix.os }}) needs: lint - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ 'ubuntu-latest' ] python-version: - "3.9" - "3.12" @@ -110,6 +120,7 @@ jobs: environment-file: environment-dev.yml create-args: >- python=${{ matrix.python-version }} + micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0). - name: Micromamba version run: | echo "micromamba $(micromamba --version)" @@ -137,19 +148,13 @@ jobs: - test-pypi - test-conda 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@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3caba40..46df52c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,7 +59,8 @@ repos: rev: v0.3.9 hooks: - id: blackdoc - additional_dependencies: [ 'black==24.4.2' ] + additional_dependencies: [ 'black==24.8.0' ] + - id: blackdoc-autoupdate-black - repo: https://github.com/kynan/nbstripout rev: 0.7.1 hooks: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 150a24d..d746e08 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -45,6 +45,7 @@ Internal changes * CI configurations have been updated to use hashed commits for PyPI-sourced dependencies. * `flake8-alphabetize` has been replaced with `ruff` for some linting checks. * Updated the notebook coding conventions to adapt to changes in `xclim-testdata`. (:pull:`246`). +* Workflows now make better use of caching to speed up the CI testing process. (:pull:`262`). Bug fixes ^^^^^^^^^ diff --git a/docs/conf.py b/docs/conf.py index ab14568..5319129 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,10 +67,8 @@ templates_path = ["_templates"] # The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst"] +# You can specify multiple suffix as a dictionary of suffix: filetype +source_suffix = {'.rst': 'restructuredtext'} # The master toctree document. master_doc = "index" diff --git a/pyproject.toml b/pyproject.toml index 5b74a5f..136ced8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + # "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython" ] dynamic = ["description", "version"] @@ -53,13 +54,13 @@ dependencies = [ dev = [ # Dev tools and testing "pip >=24.2.0", - "bump-my-version >=0.25.1", + "bump-my-version >=0.26.0", "watchdog >=4.0.0", "flake8 >=7.1.0", "flake8-alphabetize >=0.0.21", "flake8-rst-docstrings >=0.3.0", "flit >=3.9.0,<4.0", - "tox >=4.17.1", + "tox >=4.18.0", "coverage >=7.5.0", "coveralls >=4.0.1", "mypy", @@ -107,7 +108,8 @@ target-version = [ "py39", "py310", "py311", - "py312" + "py312", + "py313" ] [tool.bumpversion] @@ -228,7 +230,7 @@ py_version = 39 [tool.mypy] files = "." -python_version = 3.9 +python_version = 3.8 show_error_codes = true strict = true warn_no_return = true diff --git a/tox.ini b/tox.ini index 47af429..24518d6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -min_version = 4.17.1 +min_version = 4.18.0 envlist = lint - py{39,310,311,312} + py{39,310,311,312,313} docs coveralls requires = @@ -17,6 +17,7 @@ python = 3.10 = py310-coveralls 3.11 = py311-coveralls 3.12 = py312-coveralls + 3.13 = py313-coveralls [testenv:lint] skip_install = True