Skip to content

Commit

Permalink
Chore/multiple fixes ci precommit (ecmwf#56)
Browse files Browse the repository at this point in the history
* fix: change pre-cmmit autoupdate schedule to monthly

* fix: change the merge strategy for Changelog to Union

* fix: add .envrc to .gitignore

* ci: exclude pre-commit and readthedocs yaml from changelog ci

* ci: fix downstream-ci-hpc workflow call

* chore: update pre-commit

* chore: move gitignore

* fix: hypothesis dependency

* feat: add codeowners

* ci: add hpc-config

* chore: add python 3.10

* docs: update changelog

---------

Co-authored-by: Jesper Dramsch <jesper.dramsch@ecmwf.int>
  • Loading branch information
theissenhelen and JesperDramsch authored Sep 23, 2024
1 parent a985297 commit e9c5b55
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md merge=union
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CODEOWNERS file

# Protect workflow files
/.github/ @theissenhelen @jesperdramsch @gmertes
/.pre-commit-config.yaml @theissenhelen @jesperdramsch @gmertes
/pyproject.toml @theissenhelen @jesperdramsch @gmertes
19 changes: 19 additions & 0 deletions .github/ci-hpc-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build:
python: '3.10'
modules:
- ninja
dependencies:
- ecmwf/ecbuild@develop
- ecmwf/eccodes@develop
- ecmwf/eckit@develop
- ecmwf/odc@develop
python_dependencies:
- ecmwf/anemoi-utils@develop
- ecmwf/anemoi-datasets@develop
- ecmwf/anemoi-models@develop
- ecmwf/anemoi-graphs@develop
parallel: 64

pytest_cmd: |
python -m pytest -vv -m 'not notebook and not no_cache_init' --cov=. --cov-report=xml
python -m coverage report
3 changes: 3 additions & 0 deletions .github/workflows/changelog-pr-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main
- develop
paths-ignore:
- .pre-commit-config.yaml
- .readthedocs.yaml
jobs:
Check-Changelog:
name: Check Changelog Action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
downstream-ci-hpc:
name: downstream-ci-hpc
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
with:
anemoi-training: ecmwf/anemoi-training@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ celerybeat.pid

# Environments
.env
.envrc
.venv
env/
venv/
Expand Down
16 changes: 6 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ repos:
language: python
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
additional_dependencies: [jupyter]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down Expand Up @@ -46,7 +40,7 @@ repos:
- --force-single-line-imports
- --profile black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
rev: v0.6.4
hooks:
- id: ruff
# Next line if for documenation cod snippets
Expand All @@ -57,7 +51,7 @@ repos:
- --exit-non-zero-on-fix
- --preview
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
rev: v1.0.0
hooks:
- id: sphinx-lint
# For now, we use it. But it does not support a lot of sphinx features
Expand All @@ -72,11 +66,11 @@ repos:
- id: docconvert
args: ["numpy"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.2.1"
rev: "2.2.3"
hooks:
- id: pyproject-fmt
- repo: https://github.com/jshwi/docsig # Check docstrings against function sig
rev: v0.60.0
rev: v0.60.1
hooks:
- id: docsig
args:
Expand All @@ -87,3 +81,5 @@ repos:
- --check-class # Check class docstrings
- --disable=E113 # Disable empty docstrings
- --summary # Print a summary
ci:
autoupdate_schedule: monthly
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Keep it human-readable, your future self will thank you!
## [Unreleased](https://github.com/ecmwf/anemoi-training/compare/0.1.0...HEAD)

### Added
- Codeowners file (#56)
- Changelog merge strategy (#56)

#### Miscellaneous

Expand All @@ -27,6 +29,7 @@ Keep it human-readable, your future self will thank you!
### Fixed

- Fix `TypeError` raised when trying to JSON serialise `datetime.timedelta` object - [#43](https://github.com/ecmwf/anemoi-training/pull/43)
- Bugfixes for CI (#56)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ optional-dependencies.docs = [
"sphinx-argparse",
"sphinx-rtd-theme",
]
optional-dependencies.tests = [ "pytest", "pytest-mock" ]
optional-dependencies.tests = [ "hypothesis", "pytest", "pytest-mock" ]

urls.Changelog = "https://github.com/ecmwf/anemoi-training/CHANGELOG.md"
urls.Documentation = "https://anemoi-training.readthedocs.io/"
Expand Down

0 comments on commit e9c5b55

Please sign in to comment.