From ae7e578ded53dc981b29be80d1bd1ba38748f7e3 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:33:17 -0400 Subject: [PATCH 1/4] fast-forward cookiecutter --- .cruft.json | 2 +- .github/workflows/first-pull-request.yml | 2 +- .github/workflows/main.yml | 21 ++++++++------------- .pre-commit-config.yaml | 6 +++--- CI/requirements_ci.in | 6 +++--- CI/requirements_ci.txt | 14 ++++++-------- CONTRIBUTING.rst | 15 ++++++++------- Makefile | 2 +- environment-dev.yml | 18 +++++++++--------- pyproject.toml | 20 ++++++++++---------- tox.ini | 19 ++++++++++++++----- 11 files changed, 64 insertions(+), 61 deletions(-) diff --git a/.cruft.json b/.cruft.json index 0ac20cc..f348f15 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/Ouranosinc/cookiecutter-pypackage", - "commit": "51f9b8dff09101af573c710ad9d30e43d87b7e02", + "commit": "fb24d9af1a97700633333a8c8246b3e504e865f7", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/first-pull-request.yml b/.github/workflows/first-pull-request.yml index 7f89710..9ac7a04 100644 --- a/.github/workflows/first-pull-request.yml +++ b/.github/workflows/first-pull-request.yml @@ -56,5 +56,5 @@ jobs: It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the \`AUTHORS.rst\` and \`.zenodo.json\`: - [ ] The relevant author information has been added to \`AUTHORS.rst\` and \`.zenodo.json\`. - Please make sure you've read our [contributing guide](CONTRIBUTING.rst). We look forward to reviewing your Pull Request shortly ✨` + Please make sure you've read our [contributing guide](https://github.com/Ouranosinc/xsdba/blob/main/CONTRIBUTING.rst). We look forward to reviewing your Pull Request shortly ✨` }) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a5f05e..d6cd317 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,17 +53,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - include: - - tox-env: "py38-coveralls" - python-version: "3.8" - - tox-env: "py39-coveralls" - python-version: "3.9" - - tox-env: "py310-coveralls" - python-version: "3.10" - - tox-env: "py311-coveralls" - python-version: "3.11" - - tox-env: "py312-coveralls" - python-version: "3.12" + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" steps: - name: Harden Runner uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 @@ -80,10 +75,10 @@ jobs: python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Test with tox run: | - python -m tox -e ${{ matrix.tox-env }} + python -m tox env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: run-${{ matrix.tox-env }} + COVERALLS_FLAG_NAME: run-${{ matrix.python-version }} COVERALLS_PARALLEL: true COVERALLS_SERVICE_NAME: github diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5db378b..ca7e1f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: - id: python-use-type-annotations - id: rst-inline-touching-normal - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black exclude: ^docs/ @@ -42,7 +42,7 @@ repos: - id: isort exclude: ^docs/ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.6 + rev: v0.5.7 hooks: - id: ruff args: [ '--fix' ] @@ -64,7 +64,7 @@ repos: - id: yamllint args: [ '--config-file=.yamllint.yaml' ] - repo: https://github.com/numpy/numpydoc - rev: v1.8.0rc2 + rev: v1.8.0 hooks: - id: numpydoc-validation exclude: ^docs/|^tests/ diff --git a/CI/requirements_ci.in b/CI/requirements_ci.in index a3add9e..8956cec 100644 --- a/CI/requirements_ci.in +++ b/CI/requirements_ci.in @@ -1,5 +1,5 @@ -bump-my-version==0.24.3 +bump-my-version==0.25.1 coveralls==4.0.1 -pip==24.2 +pip==24.2.0 flit==3.9.0 -tox==4.16.0 +tox==4.17.1 diff --git a/CI/requirements_ci.txt b/CI/requirements_ci.txt index fc17256..8332427 100644 --- a/CI/requirements_ci.txt +++ b/CI/requirements_ci.txt @@ -12,9 +12,9 @@ bracex==2.4 \ --hash=sha256:a27eaf1df42cf561fed58b7a8f3fdf129d1ea16a81e1fadd1d17989bc6384beb \ --hash=sha256:efdc71eff95eaff5e0f8cfebe7d01adf2c8637c8c92edaf63ef348c241a82418 # via wcmatch -bump-my-version==0.24.3 \ - --hash=sha256:9b8ac82458a703a968a9a438b460175494cc0e0c6bd5f316019945a6b66eb81f \ - --hash=sha256:cdd86e158430dd5e5e25fc61703c140a1107579fdd8d74f8f3a5f991daa07168 +bump-my-version==0.25.1 \ + --hash=sha256:d5e72b1a88db4cc808009fd4f03c3b3ab5c06db7bf1501e4f8387eb50c352589 \ + --hash=sha256:f9a2723999be5c4416c854ad4a7f950491644944dff82a91634f8a45d1da81ac # via -r CI/requirements_ci.in cachetools==5.4.0 \ --hash=sha256:3ae3b49a3d5e28a77a0be2b37dbcb89005058959cb2323858c2657c4a8cab474 \ @@ -393,18 +393,16 @@ tomlkit==0.13.0 \ --hash=sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72 \ --hash=sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264 # via bump-my-version -tox==4.16.0 \ - --hash=sha256:43499656f9949edb681c0f907f86fbfee98677af9919d8b11ae5ad77cb800748 \ - --hash=sha256:61e101061b977b46cf00093d4319438055290ad0009f84497a07bf2d2d7a06d0 +tox==4.17.1 \ + --hash=sha256:2974597c0353577126ab014f52d1a399fb761049e165ff34427f84e8cfe6c990 \ + --hash=sha256:2c41565a571e34480bd401d668a4899806169a4633e972ac296c54406d2ded8a # via -r CI/requirements_ci.in typing-extensions==4.12.2 \ --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 # via - # annotated-types # pydantic # pydantic-core - # rich # rich-click urllib3==2.2.2 \ --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index dbbdab4..6467872 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -213,13 +213,14 @@ To run specific code style checks: .. code-block:: console - python -m black --check xsdba tests - python -m isort --check xsdba tests - python -m blackdoc --check xsdba docs - python -m ruff check xsdba tests - python -m flake8 xsdba tests - -To get ``black``, ``isort``, ``blackdoc``, ``ruff``, and ``flake8`` (with the ``flake8-rst-docstrings`` plugin) simply install them with ``pip`` (or ``conda``) into your environment. + python -m black --check src/xsdba tests + python -m isort --check src/xsdba tests + python -m blackdoc --check src/xsdba docs + python -m ruff check src/xsdba tests + python -m flake8 src/xsdba tests + validate-docstrings src/xsdba/**.py + +To get ``black``, ``isort``, ``blackdoc``, ``ruff``, ``flake8`` (with the ``flake8-rst-docstrings`` plugin), and ``numpydoc`` (for ``validate-docstrings``), simply install them with ``pip`` (or ``conda``) into your environment. Translations ------------ diff --git a/Makefile b/Makefile index c26f620..b335718 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 - validate-docstrings src/xsdba/**.py + python -m numpydoc lint 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 1cb020c..a91a1a4 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -4,21 +4,21 @@ channels: dependencies: - python >=3.9,<3.13 # Dev tools and testing - - pip >=24.0 - - bump-my-version >=0.24.3 + - pip >=24.2.0 + - bump-my-version >=0.25.1 - watchdog >=4.0.0 - - flake8 >=7.1.0 + - flake8 >=7.1.1 - flake8-rst-docstrings >=0.3.0 - flit >=3.9.0,<4.0 - - tox >=4.16.0 + - tox >=4.17.1 - coverage >=7.5.0 - - coveralls >=4.0.0 + - coveralls >=4.0.1 - typer >=0.12.3 - - pytest >=8.2.2 + - pytest >=8.3.2 - pytest-cov >=5.0.0 - - black ==24.4.2 + - black ==24.8.0 - blackdoc ==0.3.9 - isort ==5.13.2 - - numpydoc >=1.7.0 + - numpydoc >=1.8.0 - pre-commit >=3.5.0 - - ruff >=0.5.0 + - ruff >=0.5.7 diff --git a/pyproject.toml b/pyproject.toml index ddc6060..342c277 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,23 +37,23 @@ dependencies = [ [project.optional-dependencies] dev = [ # Dev tools and testing - "pip >=24.0", - "bump-my-version >=0.24.3", + "pip >=24.2.0", + "bump-my-version >=0.25.1", "watchdog >=4.0.0", - "flake8 >=7.1.0", + "flake8 >=7.1.1", "flake8-rst-docstrings >=0.3.0", "flit >=3.9.0,<4.0", - "tox >=4.16.0", + "tox >=4.17.1", "coverage >=7.5.0", - "coveralls >=4.0.0", + "coveralls >=4.0.1", "mypy", - "numpydoc >=1.7.0", - "pytest >=8.2.2", + "numpydoc >=1.8.0", + "pytest >=8.3.2", "pytest-cov >=5.0.0", - "black ==24.4.2", + "black ==24.8.0", "blackdoc ==0.3.9", "isort ==5.13.2", - "ruff >=0.5.0", + "ruff >=0.5.7", "pre-commit >=3.5.0" ] docs = [ @@ -79,7 +79,7 @@ xsdba = "xsdba.cli:app" "Changelog" = "https://xsdba.readthedocs.io/en/stable/changelog.html" "About Ouranos" = "https://ouranos.ca/en/" "Issue tracker" = "https://github.com/Ouranosinc/xsdba/issues" -"Source" = "https://github.com/Ouranosinc/xsdba/" +"Source" = "https://github.com/Ouranosinc/xsdba" [tool] diff --git a/tox.ini b/tox.ini index e1b2582..c39a4a2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -min_version = 4.16.0 +min_version = 4.17.1 envlist = lint py{38,39,310,311,312} @@ -7,19 +7,28 @@ envlist = coveralls requires = flit ~= 3.9.0 + pip >= 24.2.0 opts = --verbose +[gh] +python = + 3.8 = py38-coveralls + 3.9 = py39-coveralls + 3.10 = py310-coveralls + 3.11 = py311-coveralls + 3.12 = py312-coveralls + [testenv:lint] skip_install = True deps = - black ==24.4.2 + black ==24.8.0 blackdoc ==0.3.9 isort ==5.13.2 - flake8 >=7.1.0 + flake8 >=7.1.1 flake8-rst-docstrings >=0.3.0 - ruff >=0.5.0 - numpydoc >=1.7.0 + ruff >=0.5.7 + numpydoc >=1.8.0 commands = make lint allowlist_externals = From 495ae6cf74c1eda6a1bc6a8b77160ed7433f5cb2 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:53:59 -0400 Subject: [PATCH 2/4] add tox-gh --- CI/requirements_ci.in | 1 + CI/requirements_ci.txt | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CI/requirements_ci.in b/CI/requirements_ci.in index 8956cec..0ab4e72 100644 --- a/CI/requirements_ci.in +++ b/CI/requirements_ci.in @@ -3,3 +3,4 @@ coveralls==4.0.1 pip==24.2.0 flit==3.9.0 tox==4.17.1 +tox-gh==1.3.2 diff --git a/CI/requirements_ci.txt b/CI/requirements_ci.txt index 8332427..8cc6e4f 100644 --- a/CI/requirements_ci.txt +++ b/CI/requirements_ci.txt @@ -396,13 +396,21 @@ tomlkit==0.13.0 \ tox==4.17.1 \ --hash=sha256:2974597c0353577126ab014f52d1a399fb761049e165ff34427f84e8cfe6c990 \ --hash=sha256:2c41565a571e34480bd401d668a4899806169a4633e972ac296c54406d2ded8a + # via + # -r CI/requirements_ci.in + # tox-gh +tox-gh==1.3.2 \ + --hash=sha256:beb8d277d5d7c1a1f09c107e4ef80bd7dd2f8f5d020edfaf4c1e3ae8fd45bf6f \ + --hash=sha256:c2d6e977f66712e7cd5e5d1b655a1bd4c91ebaf3be104befdb53c81587292d7e # via -r CI/requirements_ci.in typing-extensions==4.12.2 \ --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 # via + # annotated-types # pydantic # pydantic-core + # rich # rich-click urllib3==2.2.2 \ --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ From a6f3be646bc70dcd54976d136cf9da84160bbdb0 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:57:46 -0400 Subject: [PATCH 3/4] skip numpydoc on Python3.8 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 342c277..5be9909 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ dev = [ "coverage >=7.5.0", "coveralls >=4.0.1", "mypy", - "numpydoc >=1.8.0", + "numpydoc >=1.8.0; python_version >=3.9", "pytest >=8.3.2", "pytest-cov >=5.0.0", "black ==24.8.0", From 977b4100e8ade62ce0383cacaa775f1b4397dde5 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:00:52 -0400 Subject: [PATCH 4/4] typo fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5be9909..0f782eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ dev = [ "coverage >=7.5.0", "coveralls >=4.0.1", "mypy", - "numpydoc >=1.8.0; python_version >=3.9", + "numpydoc >=1.8.0; python_version >='3.9'", "pytest >=8.3.2", "pytest-cov >=5.0.0", "black ==24.8.0",