Skip to content

Commit 592ccbb

Browse files
authored
Merge branch 'main' into enso_diagnostics
2 parents a16e5b3 + a7ab711 commit 592ccbb

621 files changed

Lines changed: 41111 additions & 26710 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ commands:
9090
# Install
9191
. /opt/conda/etc/profile.d/conda.sh
9292
mkdir /logs
93-
mamba env create
93+
mamba --version
94+
mamba install -c conda-forge "mamba>=2" # mamba<2 can't solve env
95+
mamba env create -n esmvaltool -f environment.yml
9496
conda activate esmvaltool
9597
mamba list >> /logs/conda.txt
9698
pip install << parameters.flags >> ".[<<parameters.extra>>]"> /logs/install.txt 2>&1
@@ -105,7 +107,7 @@ commands:
105107
command: |
106108
. /opt/conda/etc/profile.d/conda.sh
107109
conda activate esmvaltool
108-
flake8 -j 4
110+
pre-commit run --all
109111
- test_and_report
110112
- save_cache:
111113
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
@@ -141,7 +143,7 @@ jobs:
141143
command: |
142144
. /opt/conda/etc/profile.d/conda.sh
143145
conda activate esmvaltool
144-
flake8 -j 4
146+
pre-commit run --all
145147
- run:
146148
name: Remove source code to test the installed software
147149
command: rm -r esmvaltool
@@ -202,7 +204,8 @@ jobs:
202204
# https://docs.esmvaltool.org/en/latest/quickstart/installation.html#install-from-source
203205
. /opt/conda/etc/profile.d/conda.sh
204206
mkdir /logs
205-
mamba env create
207+
mamba install -c conda-forge "mamba>=2" # mamba<2 can't solve env
208+
mamba env create -n esmvaltool -f environment.yml
206209
conda activate esmvaltool
207210
mamba list >> /logs/conda.txt
208211
pip install --editable .[develop]
@@ -244,7 +247,7 @@ jobs:
244247
mkdir /logs
245248
. /opt/conda/etc/profile.d/conda.sh
246249
# Install
247-
mamba env create
250+
mamba env create -n esmvaltool -f environment_python.yml
248251
conda activate esmvaltool
249252
pip install .[doc]
250253
# Log versions

.codacy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
engines:
66
coverage:
7-
enabled: true
7+
enabled: false
88
exclude_paths: [
99
'tests',
1010
]

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ ESMValTool.egg-info
77

88
!.git
99
!.zenodo.json
10-

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ indent_size = 2
2727

2828
[*.{md,Rmd}]
2929
trim_trailing_whitespace = false
30-

.github/workflows/create-condalock-file.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ jobs:
7474
run: esmvaltool --help
7575
- name: Check ESMValTool help
7676
run: esmvaltool version
77-
- name: Run flake8
78-
run: flake8
77+
- name: Check code quality
78+
run: pre-commit run -a
7979
- name: Run tests
8080
run: pytest -n 2 -m "not installation"
8181
# Automated PR

.github/workflows/cron_esmvalbot_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
# push:
55
# branches:
66
# - cron_esmvalbot_test
7-
# scheduled once every 2 weeks
7+
# scheduled twice a month (on the 1st and 16th)
88
schedule:
9-
- cron: '0 4 */14 * *'
9+
- cron: '0 4 1,16 * *'
1010

1111
# Required shell entrypoint to have properly configured bash shell
1212
defaults:

.github/workflows/install-from-condalock-file.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- run: pip install -e .[develop]
5555
- run: esmvaltool --help
5656
- run: esmvaltool version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
57-
- run: flake8
57+
- run: pre-commit run -a
5858
- run: pytest -n 2 -m "not installation"
5959
- name: Upload artifacts
6060
if: ${{ always() }} # upload artifacts even if fail

.github/workflows/test-development.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ jobs:
5656
git clone https://github.com/ESMValGroup/ESMValCore.git
5757
cd ESMValCore
5858
pip install -e .[develop]
59-
- name: Run flake8
60-
run: flake8
59+
- name: Check code quality
60+
run: pre-commit run -a
6161
- name: Run tests
6262
run: pytest -n 2 -m "not installation" 2>&1 | tee develop_test_linux_artifacts_python_${{ matrix.python-version }}/test_report.txt
6363
- name: Upload artifacts

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
exit 1
6161
- name: Inspect environment
6262
run: conda list
63-
- name: Run flake8
64-
run: flake8
63+
- name: Check code quality
64+
run: pre-commit run -a
6565
- name: Run tests
6666
run: pytest -n 2 -m "not installation" 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/test_report.txt
6767
- name: Upload artifacts
@@ -112,8 +112,8 @@ jobs:
112112
run: pip install -e .[develop] 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/install.txt
113113
- name: Inspect environment
114114
run: conda list
115-
- name: Run flake8
116-
run: flake8
115+
- name: Check code quality
116+
run: pre-commit run -a
117117
- name: Run tests
118118
run: pytest -n 2 -m "not installation" 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/test_report.txt
119119
- name: Upload artifacts

.pre-commit-config.yaml

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ exclude: |
55
(?x)
66
^doc/sphinx/source/conf.py|
77
^esmvaltool/diag_scripts/extreme_events/climdex.pcic.ncdf/|
8-
^esmvaltool/diag_scripts/cvdp/
8+
^esmvaltool/diag_scripts/cvdp/|
9+
^esmvaltool/utils/nclcodestyle/
910
repos:
1011
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.6.0
12+
rev: v5.0.0
1213
hooks:
1314
- id: check-added-large-files
1415
- id: check-ast
@@ -18,41 +19,34 @@ repos:
1819
- id: end-of-file-fixer
1920
- id: trailing-whitespace
2021
args: [--markdown-linebreak-ext=md]
21-
- repo: https://github.com/adrienverge/yamllint
22-
rev: 'v1.35.1'
23-
hooks:
24-
- id: yamllint
25-
- repo: local # nclcodestyle is installed alongside ESMValTool
26-
hooks:
27-
- id: nclcodestyle
28-
name: nclcodestyle
29-
entry: nclcodestyle
30-
language: system
31-
files: '\.(ncl|NCL)$'
32-
- repo: https://github.com/lorenzwalthert/precommit/ # Checks for R
33-
rev: 'v0.4.2'
34-
hooks:
35-
- id: style-files # styler
36-
- id: lintr
37-
- repo: https://github.com/codespell-project/codespell
38-
rev: 'v2.3.0'
39-
hooks:
40-
- id: codespell
41-
- repo: https://github.com/PyCQA/isort
42-
rev: '5.13.2'
43-
hooks:
44-
- id: isort
45-
- repo: https://github.com/pre-commit/mirrors-yapf
46-
rev: 'v0.32.0'
47-
hooks:
48-
- id: yapf
49-
additional_dependencies:
50-
- 'toml'
51-
- repo: https://github.com/myint/docformatter
52-
rev: 'v1.7.5'
53-
hooks:
54-
- id: docformatter
55-
- repo: https://github.com/pycqa/flake8
56-
rev: '5.0.4'
57-
hooks:
58-
- id: flake8
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: "v0.9.3"
24+
hooks:
25+
- id: ruff
26+
args:
27+
- "--fix"
28+
# Do not use the configuration file but configure here so we can
29+
# enable more rules that are not mandatory in the configuration file.
30+
- "--select=B,E,F,I,ISC001,UP,W" # TODO: select D
31+
- "--ignore=E501"
32+
- id: ruff-format
33+
# - repo: https://github.com/adrienverge/yamllint
34+
# rev: 'v1.35.1'
35+
# hooks:
36+
# - id: yamllint
37+
# - repo: local # nclcodestyle is installed alongside ESMValTool
38+
# hooks:
39+
# - id: nclcodestyle
40+
# name: nclcodestyle
41+
# entry: nclcodestyle
42+
# language: system
43+
# files: '\.(ncl|NCL)$'
44+
# - repo: https://github.com/lorenzwalthert/precommit/ # Checks for R
45+
# rev: 'v0.4.2'
46+
# hooks:
47+
# - id: style-files # styler
48+
# - id: lintr
49+
# - repo: https://github.com/codespell-project/codespell
50+
# rev: 'v2.3.0'
51+
# hooks:
52+
# - id: codespell

0 commit comments

Comments
 (0)