diff --git a/.cruft.json b/.cruft.json index 20c9587..8995a38 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/Ouranosinc/cookiecutter-pypackage", - "commit": "260a1d5947fb55d250b258697c336ca1d23d24ed", + "commit": "bde0676566529a69276d43e1bcd78fa0b6527ed8", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/labeler.yml b/.github/labeler.yml index c88b1a7..24798db 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -8,13 +8,32 @@ # Uncomment the following lines to enable the labeler (requires labels with the same name to exist in the repository) # label 'ci' all automation-related steps and files -#'CI': -# - changed-files: -# - any-glob-to-any-file: -# - '.editorconfig' -# - '.flake8' -# - '.pre-commit-config.yaml' -# - '.yamllint.yml' -# - '.github/workflows/*' -# - 'tox.ini' -# - 'Makefile' +'CI': + - changed-files: + - any-glob-to-any-file: + - '.editorconfig' + - '.flake8' + - '.pre-commit-config.yaml' + - '.readthedocs.yml' + - '.yamllint.yml' + - '.github/workflows/*' + - 'docs/Makefile' + - 'tox.ini' + - 'CI/**/*' + - 'Makefile' +# label 'docs' all documentation-related steps and files +'docs': + - changed-files: + - any-glob-to-any-file: + - '.readthedocs.yml' + - '.zenodo.json' + - 'docs/**/*' + - 'environment-docs.yml' + - 'AUTHORS.rst' + - 'CONTRIBUTING.rst' + - 'CODE_OF_CONDUCT.md' + - 'DISCUSSION_TEMPLATE/**/*' + - 'ISSUE_TEMPLATE/**/*' + - 'ISSUE_TEMPLATE.md' + - 'PULL_REQUEST_TEMPLATE.md' + - 'README.rst' diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 5d0211a..a290694 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -19,6 +19,10 @@ on: - .zenodo.json - AUTHORS.rst - CHANGELOG.rst + - CI/**/*.in + - CI/**/*.py + - CI/**/*.txt + - CODE_OF_CONDUCT.md - CONTRIBUTING.rst - Makefile - .readthedocs.yml @@ -29,7 +33,7 @@ on: - pyproject.toml - tests/**.py - tox.ini - - xsdba/__init__.py + - src/xsdba/__init__.py workflow_dispatch: permissions: @@ -40,7 +44,6 @@ jobs: runs-on: ubuntu-latest permissions: actions: read - contents: write steps: - name: Harden Runner uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 @@ -48,30 +51,41 @@ jobs: 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@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3 + with: + app-id: ${{ secrets.OURANOS_HELPER_BOT_ID }} + private-key: ${{ secrets.OURANOS_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@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 with: python-version: "3.x" - - name: Config Commit Bot - run: | - git config --local user.email "bumpversion[bot]@ouranos.ca" - 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.OURANOS_HELPER_BOT_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.OURANOS_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/xsdba/__init__.py | cut -d ' ' -f3)" + CURRENT_VERSION="$(grep -E '__version__' src/xsdba/__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" @@ -80,10 +94,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/xsdba/__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 }} + branch: ${{ github.ref }} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0cfe7f8..9a5f05e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: - README.rst - pyproject.toml - tests/test_xsdba.py - - xsdba/__init__.py + - src/xsdba/__init__.py pull_request: concurrency: diff --git a/.zenodo.json b/.zenodo.json index 3418d8d..265816f 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -2,15 +2,26 @@ "title": "xsdba", "creators": [ { - "name": "Smith, Trevor James" + "name": "Smith, Trevor James", + "affiliation": "Ouranos, Montréal, Québec, Canada", + "orcid": "0000-0001-5393-8359" } ], "keywords": [ - "xsdba" + "xsdba", + "xarray", + "bias adjustment", + "statistical analysis", + "statistical correction", + "statistics" ], "license": "Apache-2.0", "language": "eng", - "communities": [], + "communities": [ + { + "identifier": "ouranos" + } + ], "upload_type": "software", "access_right": "open" } diff --git a/AUTHORS.rst b/AUTHORS.rst index 801dc59..3c59d7d 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -5,7 +5,7 @@ Credits Development Lead ---------------- -* Trevor James Smith `@Ouranosinc `_ +* Trevor James Smith `@Zeitsperre `_ Co-Developers ------------- diff --git a/CI/requirements_ci.in b/CI/requirements_ci.in index 5c222d6..bb240ff 100644 --- a/CI/requirements_ci.in +++ b/CI/requirements_ci.in @@ -1,4 +1,5 @@ bump-my-version==0.24.3 +coveralls==4.0.1 pip==24.1.2 flit==3.9.0 tox==4.16.0 diff --git a/CI/requirements_ci.txt b/CI/requirements_ci.txt index 0cd48c8..fc17256 100644 --- a/CI/requirements_ci.txt +++ b/CI/requirements_ci.txt @@ -130,10 +130,71 @@ colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 # via tox +coverage[toml]==7.6.0 \ + --hash=sha256:0086cd4fc71b7d485ac93ca4239c8f75732c2ae3ba83f6be1c9be59d9e2c6382 \ + --hash=sha256:01c322ef2bbe15057bc4bf132b525b7e3f7206f071799eb8aa6ad1940bcf5fb1 \ + --hash=sha256:03cafe82c1b32b770a29fd6de923625ccac3185a54a5e66606da26d105f37dac \ + --hash=sha256:044a0985a4f25b335882b0966625270a8d9db3d3409ddc49a4eb00b0ef5e8cee \ + --hash=sha256:07ed352205574aad067482e53dd606926afebcb5590653121063fbf4e2175166 \ + --hash=sha256:0d1b923fc4a40c5832be4f35a5dab0e5ff89cddf83bb4174499e02ea089daf57 \ + --hash=sha256:0e7b27d04131c46e6894f23a4ae186a6a2207209a05df5b6ad4caee6d54a222c \ + --hash=sha256:1fad32ee9b27350687035cb5fdf9145bc9cf0a094a9577d43e909948ebcfa27b \ + --hash=sha256:289cc803fa1dc901f84701ac10c9ee873619320f2f9aff38794db4a4a0268d51 \ + --hash=sha256:3c59105f8d58ce500f348c5b56163a4113a440dad6daa2294b5052a10db866da \ + --hash=sha256:46c3d091059ad0b9c59d1034de74a7f36dcfa7f6d3bde782c49deb42438f2450 \ + --hash=sha256:482855914928c8175735a2a59c8dc5806cf7d8f032e4820d52e845d1f731dca2 \ + --hash=sha256:49c76cdfa13015c4560702574bad67f0e15ca5a2872c6a125f6327ead2b731dd \ + --hash=sha256:4b03741e70fb811d1a9a1d75355cf391f274ed85847f4b78e35459899f57af4d \ + --hash=sha256:4bea27c4269234e06f621f3fac3925f56ff34bc14521484b8f66a580aacc2e7d \ + --hash=sha256:4d5fae0a22dc86259dee66f2cc6c1d3e490c4a1214d7daa2a93d07491c5c04b6 \ + --hash=sha256:543ef9179bc55edfd895154a51792b01c017c87af0ebaae092720152e19e42ca \ + --hash=sha256:54dece71673b3187c86226c3ca793c5f891f9fc3d8aa183f2e3653da18566169 \ + --hash=sha256:6379688fb4cfa921ae349c76eb1a9ab26b65f32b03d46bb0eed841fd4cb6afb1 \ + --hash=sha256:65fa405b837060db569a61ec368b74688f429b32fa47a8929a7a2f9b47183713 \ + --hash=sha256:6616d1c9bf1e3faea78711ee42a8b972367d82ceae233ec0ac61cc7fec09fa6b \ + --hash=sha256:6fe885135c8a479d3e37a7aae61cbd3a0fb2deccb4dda3c25f92a49189f766d6 \ + --hash=sha256:7221f9ac9dad9492cecab6f676b3eaf9185141539d5c9689d13fd6b0d7de840c \ + --hash=sha256:76d5f82213aa78098b9b964ea89de4617e70e0d43e97900c2778a50856dac605 \ + --hash=sha256:7792f0ab20df8071d669d929c75c97fecfa6bcab82c10ee4adb91c7a54055463 \ + --hash=sha256:831b476d79408ab6ccfadaaf199906c833f02fdb32c9ab907b1d4aa0713cfa3b \ + --hash=sha256:9146579352d7b5f6412735d0f203bbd8d00113a680b66565e205bc605ef81bc6 \ + --hash=sha256:9cc44bf0315268e253bf563f3560e6c004efe38f76db03a1558274a6e04bf5d5 \ + --hash=sha256:a73d18625f6a8a1cbb11eadc1d03929f9510f4131879288e3f7922097a429f63 \ + --hash=sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c \ + --hash=sha256:a94925102c89247530ae1dab7dc02c690942566f22e189cbd53579b0693c0783 \ + --hash=sha256:ad4567d6c334c46046d1c4c20024de2a1c3abc626817ae21ae3da600f5779b44 \ + --hash=sha256:b2e16f4cd2bc4d88ba30ca2d3bbf2f21f00f382cf4e1ce3b1ddc96c634bc48ca \ + --hash=sha256:bbdf9a72403110a3bdae77948b8011f644571311c2fb35ee15f0f10a8fc082e8 \ + --hash=sha256:beb08e8508e53a568811016e59f3234d29c2583f6b6e28572f0954a6b4f7e03d \ + --hash=sha256:c4cbe651f3904e28f3a55d6f371203049034b4ddbce65a54527a3f189ca3b390 \ + --hash=sha256:c7b525ab52ce18c57ae232ba6f7010297a87ced82a2383b1afd238849c1ff933 \ + --hash=sha256:ca5d79cfdae420a1d52bf177de4bc2289c321d6c961ae321503b2ca59c17ae67 \ + --hash=sha256:cdab02a0a941af190df8782aafc591ef3ad08824f97850b015c8c6a8b3877b0b \ + --hash=sha256:d17c6a415d68cfe1091d3296ba5749d3d8696e42c37fca5d4860c5bf7b729f03 \ + --hash=sha256:d39bd10f0ae453554798b125d2f39884290c480f56e8a02ba7a6ed552005243b \ + --hash=sha256:d4b3cd1ca7cd73d229487fa5caca9e4bc1f0bca96526b922d61053ea751fe791 \ + --hash=sha256:d50a252b23b9b4dfeefc1f663c568a221092cbaded20a05a11665d0dbec9b8fb \ + --hash=sha256:da8549d17489cd52f85a9829d0e1d91059359b3c54a26f28bec2c5d369524807 \ + --hash=sha256:dcd070b5b585b50e6617e8972f3fbbee786afca71b1936ac06257f7e178f00f6 \ + --hash=sha256:ddaaa91bfc4477d2871442bbf30a125e8fe6b05da8a0015507bfbf4718228ab2 \ + --hash=sha256:df423f351b162a702c053d5dddc0fc0ef9a9e27ea3f449781ace5f906b664428 \ + --hash=sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd \ + --hash=sha256:e7e128f85c0b419907d1f38e616c4f1e9f1d1b37a7949f44df9a73d5da5cd53c \ + --hash=sha256:ed8d1d1821ba5fc88d4a4f45387b65de52382fa3ef1f0115a4f7a20cdfab0e94 \ + --hash=sha256:f2501d60d7497fd55e391f423f965bbe9e650e9ffc3c627d5f0ac516026000b8 \ + --hash=sha256:f7db0b6ae1f96ae41afe626095149ecd1b212b424626175a6633c2999eaad45b + # via coveralls +coveralls==4.0.1 \ + --hash=sha256:7a6b1fa9848332c7b2221afb20f3df90272ac0167060f41b5fe90429b30b1809 \ + --hash=sha256:7b2a0a2bcef94f295e3cf28dcc55ca40b71c77d1c2446b538e85f0f7bc21aa69 + # via -r CI/requirements_ci.in distlib==0.3.8 \ --hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \ --hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64 # via virtualenv +docopt==0.6.2 \ + --hash=sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491 + # via coveralls docutils==0.20.1 \ --hash=sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6 \ --hash=sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b @@ -304,7 +365,9 @@ questionary==2.0.1 \ requests==2.32.3 \ --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 - # via flit + # via + # coveralls + # flit rich==13.7.1 \ --hash=sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222 \ --hash=sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432 @@ -319,6 +382,7 @@ tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f # via + # coverage # pyproject-api # tox tomli-w==1.0.0 \ diff --git a/Makefile b/Makefile index dce76f7..c26f620 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ clean-test: ## remove test and coverage artifacts lint/flake8: ## check style with flake8 python -m ruff check src/xsdba tests python -m flake8 --config=.flake8 src/xsdba tests - python -m numpydoc --validate src/xsdba + validate-docstrings src/xsdba/**.py lint/black: ## check style with black python -m black --check src/xsdba tests diff --git a/environment-dev.yml b/environment-dev.yml index 95527b7..1cb020c 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -6,7 +6,7 @@ dependencies: # Dev tools and testing - pip >=24.0 - bump-my-version >=0.24.3 - - watchdog >=3.0.0 + - watchdog >=4.0.0 - flake8 >=7.1.0 - flake8-rst-docstrings >=0.3.0 - flit >=3.9.0,<4.0 diff --git a/pyproject.toml b/pyproject.toml index 8d2ba64..82f992d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ dev = [ # Dev tools and testing "pip >=24.0", "bump-my-version >=0.24.3", - "watchdog >=3.0.0", + "watchdog >=4.0.0", "flake8 >=7.1.0", "flake8-rst-docstrings >=0.3.0", "flit >=3.9.0,<4.0", @@ -161,7 +161,7 @@ values = [ [tool.coverage.run] omit = ["tests/*.py"] relative_files = true -source = "xsdba" +source = ["xsdba"] [tool.flit.sdist] include = [ diff --git a/tox.ini b/tox.ini index 7b344f3..e1b2582 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = docs coveralls requires = - flit >= 3.9.0,<4.0.0 + flit ~= 3.9.0 opts = --verbose @@ -53,5 +53,5 @@ commands_pre = pip check commands = pytest --cov - # Coveralls requires access to a repo token set in .coveralls.yml in order to report stats + ; Coveralls requires access to a repo token set in .coveralls.yml in order to report stats coveralls: - coveralls