Skip to content

Commit

Permalink
Cookiecutter update, code formatting compliance, drop Python3.8 (#193)
Browse files Browse the repository at this point in the history
### What kind of change does this PR introduce?

* Fast-forwards the cookiecutter

### Does this PR introduce a breaking change?

Yes. Python3.8 has been dropped, and some dependencies have been pinned
higher.
  • Loading branch information
Zeitsperre authored Oct 7, 2024
2 parents dbee272 + f49d584 commit 157f726
Show file tree
Hide file tree
Showing 116 changed files with 3,090 additions and 1,485 deletions.
5 changes: 3 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "f391bbd6ee14ab2478c64a1f78b74bd9903cae81",
"commit": "1d9ee5f08d3e8e4f78a4aabb75e2ce4eff8750bf",
"checkout": null,
"context": {
"cookiecutter": {
"full_name": "Trevor James Smith",
"email": "[email protected]",
"github_username": "Zeitsperre",
"github_username": "Ouranosinc",
"project_name": "miranda",
"project_slug": "miranda",
"project_short_description": "Python utilities for climate data collection, conversion, and management.",
Expand All @@ -22,6 +22,7 @@
"create_author_file": "y",
"open_source_license": "Apache Software License 2.0",
"generated_with_cruft": "y",
"__gh_slug": "https://github.com/Ouranosinc/miranda",
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage"
}
},
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.toml]
indent_size = 2

[*.{yaml,yml}]
indent_size = 2

Expand Down
3 changes: 0 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ exclude =
docs,
tests
ignore =
AZ100,
AZ200,
AZ300,
C,
D,
E,
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- This PR fixes #xyz
- [ ] (If applicable) Documentation has been added / updated (for bug fixes / features).
- [ ] (If applicable) Tests have been added.
- [ ] CHANGES.rst has been updated (with summary of main changes).
- [ ] CHANGELOG.rst has been updated (with summary of main changes).
- [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added.

### What kind of change does this PR introduce?
Expand Down
24 changes: 17 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +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: /
directory: /.github/workflows
schedule:
interval: daily
time: '12:00'
open-pull-requests-limit: 10
interval: monthly
groups:
actions:
patterns:
- "*"

- package-ecosystem: pip
directory: /
schedule:
interval: daily
time: '12:00'
open-pull-requests-limit: 10
interval: monthly
groups:
ci:
patterns:
- "CI/*"
python:
patterns:
- "pyproject.toml"
39 changes: 29 additions & 10 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
28 changes: 17 additions & 11 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ on:
- .yamllint.yaml
- .zenodo.json
- AUTHORS.rst
- CHANGES.rst
- CHANGELOG.rst
- CI/**/*.in
- CI/**/*.py
- CI/**/*.txt
- CODE_OF_CONDUCT.md
- CONTRIBUTING.rst
- Makefile
- .readthedocs.yml
Expand All @@ -29,7 +33,7 @@ on:
- pyproject.toml
- tests/**.py
- tox.ini
- miranda/__init__.py
- src/miranda/__init__.py
workflow_dispatch:

permissions:
Expand All @@ -43,32 +47,34 @@ jobs:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
- uses: actions/checkout@v4
- name: Checkout Repository (no persist-credentials)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- uses: actions/setup-python@v5
fetch-depth: 0
- name: Set up Python3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
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: Install bump-my-version
run: |
python -m pip install "bump-my-version>=0.18.3"
- name: Current Version
run: |
bump-my-version show current_version
CURRENT_VERSION="$(grep -E '__version__' miranda/__init__.py | cut -d ' ' -f3)"
CURRENT_VERSION="$(grep -E '__version__' src/miranda/__init__.py | cut -d ' ' -f3)"
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
run: |
if [[ ${{ env.CURRENT_VERSION }} =~ -dev(\.\d+)? ]]; then
Expand All @@ -80,7 +86,7 @@ jobs:
fi
bump-my-version show-bump
- name: Push Changes
uses: ad-m/github-push-action@master
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0
with:
force: false
github_token: ${{ secrets.BUMP_VERSION_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/cache-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
actions: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -25,7 +25,8 @@ jobs:
github.com:443
objects.githubusercontent.com:443
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Cleanup
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
push:
branches: [ "main" ]
paths-ignore:
- CHANGES.rst
- ../../CHANGELOG.rst
- pyproject.toml
- tox.ini
- miranda/__init__.py
Expand Down Expand Up @@ -53,7 +53,8 @@ jobs:
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# Details on CodeQL's query packs refer to:
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
# Public documentation:
# https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on:
pull_request:
Expand All @@ -16,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
disable-sudo: true
egress-policy: block
Expand All @@ -25,8 +27,8 @@ jobs:
api.github.com:443
github.com:443
- name: 'Checkout Repository'
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: 'Dependency Review'
uses: actions/dependency-review-action@0659a74c94536054bfa5aeb92241f70d680cc78e
- name: Dependency Review
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
13 changes: 10 additions & 3 deletions .github/workflows/first-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ on:
types:
- opened

permissions:
contents: read

jobs:
welcome:
name: Welcome
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
- uses: actions/github-script@v7
- name: Verify Pull Request Opener
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
// Get a list of all issues created by the PR opener
Expand Down Expand Up @@ -50,5 +56,6 @@ 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/miranda/blob/main/CONTRIBUTING.rst).
We look forward to reviewing your Pull Request shortly ✨`
})
7 changes: 3 additions & 4 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ jobs:
name: Label
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
- uses: actions/[email protected]
- name: Label Pull Request
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 157f726

Please sign in to comment.