Skip to content

Commit ee99e05

Browse files
author
Jan-Hendrik Malles
committed
Merge main
2 parents 9f61cb4 + 69e2187 commit ee99e05

388 files changed

Lines changed: 62273 additions & 5689 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: 73 additions & 206 deletions
Original file line numberDiff line numberDiff line change
@@ -2,253 +2,122 @@
22
version: 2.1
33

44
orbs:
5-
codecov: codecov/codecov@5.3.0
5+
codecov: codecov/codecov@6.0.0
6+
pixi: prefix-dev/pixi@0.1.0
67

7-
commands:
8-
check_changes:
8+
jobs:
9+
test:
10+
# Run tests.
11+
docker:
12+
- image: cimg/base:current
13+
resource_class: large
914
steps:
15+
- checkout
16+
- pixi/pixi_setup
1017
- run:
11-
name: Check whether or not installation tests are needed
12-
command: |
13-
if (test "$CIRCLE_BRANCH" = main ||
14-
git --no-pager diff --name-only origin/main... |
15-
grep -q -E -f .circleci/install_triggers)
16-
then
17-
echo Running installation tests
18-
else
19-
echo Skipping installation tests
20-
circleci step halt
21-
fi
22-
test_and_report:
23-
parameters:
24-
args:
25-
type: string
26-
default: ""
27-
steps:
18+
name: Check dependencies are compatible
19+
command: pixi run --as-is pip check
2820
- run:
2921
name: Run tests
3022
command: |
31-
mkdir -p test-reports
32-
. /opt/conda/etc/profile.d/conda.sh
33-
conda activate esmvaltool
34-
pytest -n 4 --junitxml=test-reports/report.xml << parameters.args >>
35-
esmvaltool version
36-
esmvaltool -- --help
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 --no-deps 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: ""
46+
47+
test_with_upstream_developments:
48+
# Test with development versions of upstream packages.
49+
docker:
50+
- image: cimg/base:current
51+
resource_class: large
6552
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
7153
- 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" }}
54+
- pixi/pixi_setup
7855
- run:
79-
name: Install dependencies
56+
name: Install development versions of upstream packages
8057
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
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
9869
- run:
99-
name: Log versions
70+
name: Run tests
10071
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
72+
pixi run --as-is test -n 4 --junitxml=test-reports/report.xml
10673
- run:
107-
name: Check dependencies are compatible
74+
name: Test the command line interface
10875
command: |
109-
if [[ "<< parameters.upstream_packages >>" = "" ]]; then
110-
. /opt/conda/etc/profile.d/conda.sh
111-
conda activate esmvaltool
112-
pip check
113-
else
114-
echo "Skipping `pip check` due to upstream packages"
115-
fi
116-
- test_and_report
117-
- save_cache:
118-
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
119-
paths:
120-
- /opt/conda/pkgs
121-
- /root/.cache/pip
122-
- .mypy_cache
123-
- .pytest_cache
124-
125-
jobs:
126-
run_tests:
127-
# Run tests
128-
docker:
129-
- image: esmvalgroup/esmvalcore:development
130-
resource_class: large
131-
steps:
132-
- checkout
133-
- run:
134-
name: Generate cache key
135-
command: date '+%Y-%V' | tee cache_key.txt
136-
- restore_cache:
137-
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
76+
pixi run --as-is esmvaltool version
77+
pixi run --as-is esmvaltool -- --help
78+
- store_test_results:
79+
path: test-reports/report.xml
13880
- run:
139-
name: Install dependencies
140-
command: |
141-
. /opt/conda/etc/profile.d/conda.sh
142-
mkdir /logs
143-
conda activate esmvaltool
144-
pip install --no-deps .[test] > /logs/install.txt 2>&1
145-
pip check
146-
- test_and_report:
147-
args: --cov
148-
- save_cache:
149-
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
150-
paths:
151-
- /root/.cache/pip
152-
- .mypy_cache
153-
- .pytest_cache
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
15485
- run:
155-
name: Install gpg (required by codecov orb)
156-
command: apt update && apt install -y gpg
157-
- codecov/upload:
158-
files: "test-reports/coverage.xml"
159-
disable_search: true
160-
161-
test_installation_from_source_test_mode:
162-
# Test installation from source
163-
docker:
164-
- image: condaforge/miniforge3
165-
resource_class: large
166-
steps:
167-
- test_installation_from_source
168-
169-
test_installation_from_source_develop_mode:
170-
# Test development installation
171-
docker:
172-
- image: condaforge/miniforge3
173-
resource_class: large
174-
steps:
175-
- test_installation_from_source:
176-
extra: develop
177-
flags: "--editable"
178-
179-
test_with_upstream_developments:
180-
# Test with development versions of upstream packages
181-
docker:
182-
- image: condaforge/miniforge3
183-
resource_class: large
184-
steps:
185-
- test_installation_from_source:
186-
upstream_packages: >-
187-
git+https://github.com/esgf/esgf-pyclient
188-
git+https://github.com/euro-cordex/py-cordex
189-
git+https://github.com/SciTools/cartopy
190-
git+https://github.com/SciTools/cf-units
191-
git+https://github.com/SciTools/iris
192-
git+https://github.com/SciTools/iris-grib
193-
git+https://github.com/SciTools/nc-time-axis
194-
git+https://github.com/SciTools-incubator/iris-esmf-regrid
195-
git+https://github.com/SciTools-incubator/python-stratify
196-
git+https://github.com/Toblerity/Fiona
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
19790

19891
test_installation_from_conda:
199-
# Test conda package installation
200-
working_directory: /esmvaltool
92+
# Test installation from conda-forge.
20193
docker:
202-
- image: condaforge/miniforge3
94+
- image: mambaorg/micromamba
20395
resource_class: medium
20496
steps:
20597
- run:
98+
name: Install ESMValCore from conda
20699
command: |
207-
. /opt/conda/etc/profile.d/conda.sh
208-
set -x
209-
# Install prerequisites
210-
mkdir /logs
211-
# Create and activate conda environment
212-
mamba create -y --name esmvaltool 'python=3.12'
213-
set +x; conda activate esmvaltool; set -x
214-
# Install
215-
mamba install -y esmvalcore
216-
# Log versions
217-
conda env export | tee /logs/environment.yml
218-
# Test installation
219-
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
220104
221105
build_documentation:
222-
# Test building documentation
106+
# Test building documentation.
223107
docker:
224-
- image: condaforge/miniforge3
225-
resource_class: medium
108+
- image: cimg/base:current
109+
resource_class: small
226110
steps:
227111
- checkout
112+
- pixi/pixi_setup
228113
- run:
229-
command: |
230-
mkdir /logs
231-
. /opt/conda/etc/profile.d/conda.sh
232-
# Install
233-
mamba env create -n esmvaltool -f environment.yml
234-
conda activate esmvaltool
235-
pip install --no-deps .[doc]
236-
pip check
237-
# Log versions
238-
dpkg -l | tee /logs/versions.txt
239-
conda env export | tee /logs/environment.yml
240-
pip freeze | tee /logs/requirements.txt
241-
# Test building documentation
242-
MPLBACKEND=Agg sphinx-build -W doc doc/build
243-
- store_artifacts:
244-
path: /logs
114+
name: Build documentation
115+
command: pixi run --as-is doc --fail-on-warning --show-traceback
245116

246117
workflows:
247118
commit:
248119
jobs:
249-
- run_tests
250-
- test_installation_from_source_develop_mode
251-
- test_installation_from_source_test_mode
120+
- test
252121

253122
nightly:
254123
triggers:
@@ -260,8 +129,6 @@ workflows:
260129
- main
261130
jobs:
262131
- build_documentation
263-
- run_tests
132+
- test
264133
- test_installation_from_conda
265-
- test_installation_from_source_develop_mode
266-
- test_installation_from_source_test_mode
267134
- test_with_upstream_developments

.circleci/install_triggers

Lines changed: 0 additions & 3 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

.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

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ updates:
1212
directory: "/"
1313
schedule:
1414
interval: "weekly"
15+
cooldown:
16+
default-days: 7
17+
labels:
18+
- dependencies
19+
- github_actions
20+
- automatedPR
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
doc/contributing.rst

0 commit comments

Comments
 (0)