diff --git a/.cruft.json b/.cruft.json index f348f15..638e7fd 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/Ouranosinc/cookiecutter-pypackage", - "commit": "fb24d9af1a97700633333a8c8246b3e504e865f7", + "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 713aec8..e1b4753 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,17 +49,19 @@ jobs: python -m tox -e lint test-pypi: - name: Test with Python${{ matrix.python-version }} (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.8" - "3.9" - "3.10" - "3.11" - "3.12" + # - "3.13.0-rc.2" steps: - name: Harden Runner uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 @@ -70,9 +73,15 @@ 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: Test with tox run: | python -m tox @@ -83,11 +92,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.10", "3.11", "3.12" ] defaults: run: @@ -103,18 +113,17 @@ jobs: uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0 with: cache-downloads: true + cache-environment: true environment-file: environment-dev.yml create-args: >- python=${{ matrix.python-version }} - - name: Conda and Mamba versions - run: | - echo "micromamba $(micromamba --version)" + micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0). - name: Install xsdba run: | python -m pip install --no-deps . - name: Check versions run: | - conda list + micromamba list python -m pip check || true - name: Test with pytest run: | @@ -133,19 +142,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/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 95075ed..c3f00f1 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -40,4 +40,4 @@ jobs: run: | python -m flit build - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0 + uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # v1.10.1 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c09f39c..9d58758 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -80,6 +80,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # 3.26.6 + uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # 3.26.6 with: sarif_file: results.sarif diff --git a/.github/workflows/tag-testpypi.yml b/.github/workflows/tag-testpypi.yml index 865b49b..e2ddb6b 100644 --- a/.github/workflows/tag-testpypi.yml +++ b/.github/workflows/tag-testpypi.yml @@ -64,7 +64,7 @@ jobs: run: | python -m flit build - name: Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0 + uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # v1.10.1 with: repository-url: https://test.pypi.org/legacy/ skip-existing: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5cfa2f8..51f9037 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: rev: v3.17.0 hooks: - id: pyupgrade - args: [ '--py38-plus' ] + args: [ '--py39-plus' ] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: @@ -57,7 +57,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/adrienverge/yamllint.git rev: v1.35.1 hooks: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 20bcc4f..523ea3c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -61,7 +61,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -[INSERT CONTACT METHOD]. +[github-support@ouranos.ca](mailto:github-support@ouranos.ca). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/docs/conf.py b/docs/conf.py index 12f11a1..abfc55f 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,17 +63,15 @@ 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' # General information about the project. project = 'xsdba' -copyright = "2024, Trevor James Smith" +copyright = "2024, Ouranosinc, Éric Dupuis, Trevor James Smith" author = "Trevor James Smith" # The version info for the project you're documenting, acts as replacement @@ -81,7 +79,7 @@ # the built documents. # # The short X.Y version. -version = xsdba.__version__ +version = xsdba.__version__.split('-')[0] # The full version, including alpha/beta/rc tags. release = xsdba.__version__ diff --git a/pyproject.toml b/pyproject.toml index 0f782eb..2670a82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,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"] @@ -38,12 +39,12 @@ 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.1", "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", @@ -89,7 +90,8 @@ target-version = [ "py39", "py310", "py311", - "py312" + "py312", + "py313" ] [tool.bumpversion] @@ -157,6 +159,9 @@ values = [ "release" ] +[tool.coverage.paths] +source = ["src/xsdba/", "*/site-packages/xsdba/"] + [tool.coverage.run] omit = ["tests/*.py"] relative_files = true @@ -206,7 +211,7 @@ py_version = 38 [tool.mypy] files = "." -python_version = 3.9 +python_version = 3.8 show_error_codes = true strict = true warn_no_return = true @@ -254,7 +259,6 @@ testpaths = "tests" [tool.ruff] src = ["xsdba"] line-length = 150 -target-version = "py38" exclude = [ ".eggs", ".git", diff --git a/src/xsdba/__init__.py b/src/xsdba/__init__.py index 453dc9d..dd14246 100644 --- a/src/xsdba/__init__.py +++ b/src/xsdba/__init__.py @@ -3,7 +3,7 @@ ################################################################################### # Apache Software License 2.0 # -# Copyright (c) 2024, Trevor James Smith +# Copyright (c) 2024, Ouranos Inc., Éric Dupuis, Trevor James Smith # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tox.ini b/tox.ini index c39a4a2..b859edb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -min_version = 4.17.1 +min_version = 4.18.0 envlist = lint - py{38,39,310,311,312} + py{39,310,311,312,313} docs - coveralls requires = - flit ~= 3.9.0 + flit >= 3.9.0,<4.0 pip >= 24.2.0 opts = --verbose @@ -18,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