Skip to content

Commit

Permalink
Merge pull request #69 from ecmwf-projects/template-update
Browse files Browse the repository at this point in the history
template update
  • Loading branch information
malmans2 authored Nov 17, 2023
2 parents 7496113 + 76e567e commit 7f72d98
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/ecmwf-projects/cookiecutter-conda-package",
"commit": "519dfc3783111cd3fde95aebc84101297152c45e",
"commit": "ce9afbb8510935c0206746d26f05f6b80e9d0087",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install conda-merge
run: |
python -m pip install conda-merge
Expand Down Expand Up @@ -61,11 +64,16 @@ jobs:
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
Expand All @@ -85,11 +93,16 @@ jobs:
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=3.10
- name: Install package
Expand All @@ -109,11 +122,16 @@ jobs:
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=3.10
- name: Install package
Expand Down Expand Up @@ -141,11 +159,16 @@ jobs:
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/combined-environment${{ matrix.extra }}.yml
environment-name: DEVELOP${{ matrix.extra }}
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
Expand All @@ -167,6 +190,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install package
run: |
python -m pip install --upgrade pip
Expand All @@ -189,7 +215,11 @@ jobs:
upload-to-pypi:
runs-on: ubuntu-latest
needs: distribution
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
if: |
always() &&
needs.distribution.result == 'success' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/cads-adaptors
Expand Down
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ repos:
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black
- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: [black==22.3.0]
additional_dependencies: [black==23.11.0]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.1
rev: v0.1.5
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ ignore = [
# pydocstyle: First line should be in imperative mood; try rephrasing
"D401"
]
# Black line length is 88, but black does not format comments.
line-length = 110
# Same as Black.
indent-width = 4
line-length = 88
select = [
# pyflakes
"F",
Expand All @@ -65,6 +66,9 @@ select = [
"D"
]

[tool.ruff.lint.pycodestyle]
max-line-length = 110

[tool.ruff.pydocstyle]
convention = "numpy"

Expand Down

0 comments on commit 7f72d98

Please sign in to comment.