Skip to content

Commit ec31df7

Browse files
committed
Merge remote-tracking branch 'origin/main' into grouping_for_fix_metadata
2 parents cabc32c + 887ffdf commit ec31df7

554 files changed

Lines changed: 73537 additions & 14353 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: 74 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -2,245 +2,122 @@
22
version: 2.1
33

44
orbs:
5-
coverage-reporter: codacy/coverage-reporter@14.0.0
6-
codecov: codecov/codecov@4.1.0
5+
codecov: codecov/codecov@5.3.0
6+
pixi: prefix-dev/pixi@0.1.0
77

8-
commands:
9-
check_changes:
8+
jobs:
9+
test:
10+
# Run tests.
11+
docker:
12+
- image: cimg/base:current
13+
resource_class: large
1014
steps:
15+
- checkout
16+
- pixi/pixi_setup
1117
- run:
12-
name: Check whether or not installation tests are needed
13-
command: |
14-
if (test "$CIRCLE_BRANCH" = main ||
15-
git --no-pager diff --name-only origin/main... |
16-
grep -q -E -f .circleci/install_triggers)
17-
then
18-
echo Running installation tests
19-
else
20-
echo Skipping installation tests
21-
circleci step halt
22-
fi
23-
test_and_report:
24-
parameters:
25-
args:
26-
type: string
27-
default: ""
28-
steps:
18+
name: Check dependencies are compatible
19+
command: pixi run --as-is pip check
2920
- run:
3021
name: Run tests
3122
command: |
32-
mkdir -p test-reports
33-
. /opt/conda/etc/profile.d/conda.sh
34-
conda activate esmvaltool
35-
pytest -n 4 --junitxml=test-reports/report.xml << parameters.args >>
36-
esmvaltool version
23+
pixi run --as-is test --cov -n 4 --durations=10 --junitxml=test-reports/report.xml
24+
- run:
25+
name: Test the command line interface
26+
command: |
27+
pixi run --as-is esmvaltool version
28+
pixi run --as-is esmvaltool -- --help
29+
pixi run --as-is esmvaltool config list
30+
pixi run --as-is esmvaltool config show
31+
- codecov/upload:
32+
files: "test-reports/coverage.xml"
33+
disable_search: true
3734
- store_test_results:
3835
path: test-reports/report.xml
39-
- store_artifacts:
40-
path: /logs
4136
- run:
4237
name: Compress pytest artifacts
43-
command: tar -cvzf pytest.tar.gz -C /tmp/pytest-of-root/pytest-0/ .
38+
command: tar -cvzf pytest.tar.gz -C /tmp/pytest-of-$(whoami)/ .
4439
- store_artifacts:
4540
path: pytest.tar.gz
4641
- run:
4742
name: Compress test-report artifacts
4843
command: tar -cvzf test-reports.tar.gz test-reports/
4944
- store_artifacts:
5045
path: test-reports.tar.gz
51-
test_installation_from_source:
52-
parameters:
53-
extra:
54-
description: pip "extra"s to install
55-
type: string
56-
default: "test"
57-
flags:
58-
description: pip install flags
59-
type: string
60-
default: ""
61-
upstream_packages:
62-
description: List of packages that will be installed with pip.
63-
type: string
64-
default: ""
65-
steps:
66-
- run:
67-
name: Install git+ssh
68-
environment:
69-
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
70-
command: apt update && apt install -y git ssh
71-
- checkout
72-
- check_changes
73-
- run:
74-
name: Generate cache key
75-
command: date '+%Y-%V' | tee cache_key.txt
76-
- restore_cache:
77-
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
78-
- run:
79-
name: Install dependencies
80-
command: |
81-
# Add additional requirements for running all tests
82-
echo "
83-
- r-base
84-
- r-yaml
85-
- ncl
86-
" >> environment.yml
87-
# Installation of development version of packages requires compilers
88-
if [[ "<< parameters.upstream_packages >>" ]]; then
89-
echo " - compilers" >> environment.yml
90-
fi
91-
# Install
92-
. /opt/conda/etc/profile.d/conda.sh
93-
mkdir /logs
94-
mamba env create -n esmvaltool -f environment.yml |& tee /logs/conda.txt
95-
git stash # Restore repository state to get clean version number.
96-
conda activate esmvaltool
97-
pip install --no-deps << parameters.flags >> ".[<<parameters.extra>>]" << parameters.upstream_packages >> |& tee /logs/install.txt
98-
- run:
99-
name: Log versions
100-
command: |
101-
. /opt/conda/etc/profile.d/conda.sh
102-
conda activate esmvaltool
103-
dpkg -l | tee /logs/versions.txt
104-
conda env export | tee /logs/environment.yml
105-
pip freeze | tee /logs/requirements.txt
106-
- test_and_report
107-
- save_cache:
108-
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
109-
paths:
110-
- /opt/conda/pkgs
111-
- /root/.cache/pip
112-
- .mypy_cache
113-
- .pytest_cache
11446

115-
jobs:
116-
run_tests:
117-
# Run tests
47+
test_with_upstream_developments:
48+
# Test with development versions of upstream packages.
11849
docker:
119-
- image: esmvalgroup/esmvalcore:development
50+
- image: cimg/base:current
12051
resource_class: large
12152
steps:
12253
- checkout
54+
- pixi/pixi_setup
12355
- run:
124-
name: Generate cache key
125-
command: date '+%Y-%V' | tee cache_key.txt
126-
- restore_cache:
127-
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
56+
name: Install development versions of upstream packages
57+
command: |
58+
pixi run --as-is pip install \
59+
git+https://github.com/esgf2-us/intake-esgf \
60+
git+https://github.com/euro-cordex/py-cordex \
61+
git+https://github.com/SciTools/cartopy \
62+
git+https://github.com/SciTools/cf-units \
63+
git+https://github.com/SciTools/iris \
64+
git+https://github.com/SciTools/iris-grib \
65+
git+https://github.com/SciTools/nc-time-axis \
66+
git+https://github.com/SciTools/ncdata \
67+
git+https://github.com/SciTools/iris-esmf-regrid \
68+
git+https://github.com/SciTools/python-stratify
12869
- run:
129-
name: Install dependencies
70+
name: Run tests
13071
command: |
131-
. /opt/conda/etc/profile.d/conda.sh
132-
mkdir /logs
133-
conda activate esmvaltool
134-
pip install .[test] > /logs/install.txt 2>&1
135-
- test_and_report:
136-
args: --cov
137-
- save_cache:
138-
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
139-
paths:
140-
- /root/.cache/pip
141-
- .mypy_cache
142-
- .pytest_cache
72+
pixi run --as-is test -n 4 --junitxml=test-reports/report.xml
14373
- run:
144-
name: Install gpg (required by codecov orb)
145-
command: apt update && apt install -y gpg
146-
- codecov/upload:
147-
when: always
148-
file: 'test-reports/coverage.xml'
149-
- coverage-reporter/send_report:
150-
coverage-reports: 'test-reports/coverage.xml'
151-
project-token: $CODACY_PROJECT_TOKEN
152-
skip: true # skip if project-token is not defined (i.e. on a fork)
153-
154-
test_installation_from_source_test_mode:
155-
# Test installation from source
156-
docker:
157-
- image: condaforge/miniforge3
158-
resource_class: large
159-
steps:
160-
- test_installation_from_source
161-
162-
test_installation_from_source_develop_mode:
163-
# Test development installation
164-
docker:
165-
- image: condaforge/miniforge3
166-
resource_class: large
167-
steps:
168-
- test_installation_from_source:
169-
extra: develop
170-
flags: "--editable"
171-
172-
test_with_upstream_developments:
173-
# Test with development versions of upstream packages
174-
docker:
175-
- image: condaforge/miniforge3
176-
resource_class: large
177-
steps:
178-
- test_installation_from_source:
179-
upstream_packages: >-
180-
git+https://github.com/esgf/esgf-pyclient
181-
git+https://github.com/euro-cordex/py-cordex
182-
git+https://github.com/SciTools/cartopy
183-
git+https://github.com/SciTools/cf-units
184-
git+https://github.com/SciTools/iris
185-
git+https://github.com/SciTools/iris-grib
186-
git+https://github.com/SciTools/nc-time-axis
187-
git+https://github.com/SciTools-incubator/iris-esmf-regrid
188-
git+https://github.com/SciTools-incubator/python-stratify
189-
git+https://github.com/Toblerity/Fiona
74+
name: Test the command line interface
75+
command: |
76+
pixi run --as-is esmvaltool version
77+
pixi run --as-is esmvaltool -- --help
78+
- store_test_results:
79+
path: test-reports/report.xml
80+
- run:
81+
name: Compress pytest artifacts
82+
command: tar -cvzf pytest.tar.gz -C /tmp/pytest-of-$(whoami)/ .
83+
- store_artifacts:
84+
path: pytest.tar.gz
85+
- run:
86+
name: Compress test-report artifacts
87+
command: tar -cvzf test-reports.tar.gz test-reports/
88+
- store_artifacts:
89+
path: test-reports.tar.gz
19090

19191
test_installation_from_conda:
192-
# Test conda package installation
193-
working_directory: /esmvaltool
92+
# Test installation from conda-forge.
19493
docker:
195-
- image: condaforge/miniforge3
94+
- image: mambaorg/micromamba
19695
resource_class: medium
19796
steps:
19897
- run:
98+
name: Install ESMValCore from conda
19999
command: |
200-
. /opt/conda/etc/profile.d/conda.sh
201-
set -x
202-
# Install prerequisites
203-
mkdir /logs
204-
# Create and activate conda environment
205-
mamba create -y --name esmvaltool 'python=3.11'
206-
set +x; conda activate esmvaltool; set -x
207-
# Install
208-
mamba install -y esmvalcore
209-
# Log versions
210-
conda env export | tee /logs/environment.yml
211-
# Test installation
212-
esmvaltool version
100+
micromamba create -y --name esmvalcore esmvalcore
101+
micromamba env export --name esmvalcore
102+
micromamba run --name esmvalcore esmvaltool -- --help
103+
micromamba run --name esmvalcore esmvaltool version
213104
214105
build_documentation:
215-
# Test building documentation
106+
# Test building documentation.
216107
docker:
217-
- image: condaforge/miniforge3
218-
resource_class: medium
108+
- image: cimg/base:current
109+
resource_class: small
219110
steps:
220111
- checkout
112+
- pixi/pixi_setup
221113
- run:
222-
command: |
223-
mkdir /logs
224-
. /opt/conda/etc/profile.d/conda.sh
225-
# Install
226-
mamba env create -n esmvaltool -f environment.yml
227-
conda activate esmvaltool
228-
pip install .[doc]
229-
# Log versions
230-
dpkg -l | tee /logs/versions.txt
231-
conda env export | tee /logs/environment.yml
232-
pip freeze | tee /logs/requirements.txt
233-
# Test building documentation
234-
MPLBACKEND=Agg sphinx-build -W doc doc/build
235-
- store_artifacts:
236-
path: /logs
114+
name: Build documentation
115+
command: pixi run --as-is doc --fail-on-warning --show-traceback
237116

238117
workflows:
239118
commit:
240119
jobs:
241-
- run_tests
242-
- test_installation_from_source_develop_mode
243-
- test_installation_from_source_test_mode
120+
- test
244121

245122
nightly:
246123
triggers:
@@ -252,8 +129,6 @@ workflows:
252129
- main
253130
jobs:
254131
- build_documentation
255-
- run_tests
132+
- test
256133
- test_installation_from_conda
257-
- test_installation_from_source_develop_mode
258-
- test_installation_from_source_test_mode
259134
- test_with_upstream_developments

.circleci/install_triggers

Lines changed: 0 additions & 3 deletions
This file was deleted.

.codacy.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
**/__pycache__
3+
.*
4+
doc
5+
tests
6+
ESMValCore.egg-info
7+
8+
!.git
9+
!.zenodo.json

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# Use ruff formatter (#2524)
22
436558caacda69d4966a5aff35959ce9188cac37
3+
# Enable more ruff rules (#2715)
4+
77c370314bac1e72400392ed98c8f2f75b1b5a98
5+
02583113c99304e4e99bd010a05856ea429259ea
6+
0e8e7164ef96c574f77367948f51c7ab822bb694
7+
e2f8cab2cc5a509452ca720e50f041f46f380ee2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff

0 commit comments

Comments
 (0)