Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cookiecutter #138

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "3b3598ae9524e7eb495bcba91093fac3369e753a",
"commit": "9e52dd4dcbae384ca055d1edd4aa79ec5b436ca0",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -22,7 +22,26 @@
"create_author_file": "y",
"open_source_license": "MIT license",
"generated_with_cruft": "y",
"__gh_slug": "https://github.com/hydrologie/xdatasets",
"__gh_slug": "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_name.replace(' ', '-') }}",
"__prompts__": {
"full_name": "Your full name",
"email": "Your email address",
"github_username": "Your GitHub username (or organization)",
"project_name": "The name of your project",
"project_short_description": "A short description of your project",
"pypi_username": "Your PyPI username (or organization)",
"version": "The version of your project",
"use_pytest": "Do you want to use pytest?",
"use_black": "Do you want to use Black for code formatting?",
"use_conda": "Do you want to add configurations for Anaconda package management?",
"add_pyup_badge": "Do you want to add a pyup.io badge? (not recommended)",
"make_docs": "Do you want to generate documentation files",
"add_translations": "Do you want to add translations?",
"command_line_interface": "Which command-line interface do you want to use?",
"create_author_file": "Do you want to create an AUTHORS.rst file?",
"open_source_license": "Which open-source license do you want to use?",
"generated_with_cruft": "Was this project generated with Cruft? (Add a '.cruft.json' file)"
},
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage"
}
},
Expand Down
19 changes: 19 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,26 @@
- '.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'
18 changes: 10 additions & 8 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
- .yamllint.yaml
- AUTHORS.rst
- CHANGELOG.rst
- CI/**/*.in
- CI/**/*.py
- CI/**/*.txt
- CODE_OF_CONDUCT.md
- CONTRIBUTING.rst
- docs/notebooks/**.ipynb
- docs/*.py
Expand All @@ -30,7 +34,7 @@ on:
- pyproject.toml
- tests/**.py
- tox.ini
- xdatasets/__init__.py
- src/xdatasets/__init__.py

permissions:
contents: read
Expand All @@ -43,7 +47,7 @@ jobs:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand All @@ -57,22 +61,20 @@ jobs:
persist-credentials: false
fetch-depth: 0
- name: Set up Python3
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
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]@hydrologie.com"
git config --local user.name "bumpversion[bot]"
- name: Install bump-my-version
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt

- name: Current Version
run: |
bump-my-version show current_version
CURRENT_VERSION="$(grep -E '__version__' src/xdatasets/__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 Down
2 changes: 1 addition & 1 deletion .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@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 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
Expand All @@ -16,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand All @@ -29,4 +30,4 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Dependency Review
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
3 changes: 1 addition & 2 deletions .github/workflows/first-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ jobs:
name: Welcome
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ 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@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- README.rst
- pyproject.toml
- tests/test_xdatasets.py
- xdatasets/__init__.py
- src/xdatasets/__init__.py
pull_request:

concurrency:
Expand All @@ -31,16 +31,16 @@ jobs:
- "3.x"
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Run linting suite
Expand All @@ -56,19 +56,19 @@ jobs:
strategy:
matrix:
include:
- tox-env: "py38"
- tox-env: "py38-coveralls"
python-version: "3.8"
- tox-env: "py39"
- tox-env: "py39-coveralls"
python-version: "3.9"
- tox-env: "py310"
- tox-env: "py310-coveralls"
python-version: "3.10"
- tox-env: "py311"
- tox-env: "py311-coveralls"
python-version: "3.11"
- tox-env: "py312"
- tox-env: "py312-coveralls"
python-version: "3.12"
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout Repository
Expand All @@ -85,7 +85,7 @@ jobs:
cache: true
version: ${{ env.ESMF_VERSION }}
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand All @@ -107,13 +107,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout Repository
Expand Down Expand Up @@ -155,14 +155,16 @@ jobs:
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Checkout Repository (sparse-checkout)
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
sparse-checkout: |
CI/requirements_ci.txt
- name: Coveralls Finished
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Coveralls Finished
run: |
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand All @@ -30,10 +30,10 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python3
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.x"
- name: Install packaging libraries
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Build a binary wheel and a source tarball
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: Upload Artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: SARIF file
path: results.sarif
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create Release
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # 2.0.6
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # 2.0.8
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -42,7 +42,7 @@ jobs:
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
disable-sudo: true
egress-policy: block
Expand All @@ -54,10 +54,10 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python3
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.x"
- name: Install packaging libraries
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Build a binary wheel and a source tarball
Expand Down
Loading
Loading