Skip to content

Commit b65e579

Browse files
committed
Merge remote-tracking branch 'upstream/master' into read_grid_mapping_and_bounds_as_coords
* upstream/master: (51 commits) Ensure maximum accuracy when encoding and decoding cftime.datetime values (pydata#4758) Fix `bounds_error=True` ignored with 1D interpolation (pydata#4855) add a drop_conflicts strategy for merging attrs (pydata#4827) update pre-commit hooks (mypy) (pydata#4883) ensure warnings cannot become errors in assert_ (pydata#4864) update pre-commit hooks (pydata#4874) small fixes for the docstrings of swap_dims and integrate (pydata#4867) Modify _encode_datetime_with_cftime for compatibility with cftime > 1.4.0 (pydata#4871) vélin (pydata#4872) don't skip the doctests CI (pydata#4869) fix da.pad example for numpy 1.20 (pydata#4865) temporarily pin dask (pydata#4873) Add units if "unit" is in the attrs. (pydata#4850) speed up the repr for big MultiIndex objects (pydata#4846) dim -> coord in DataArray.integrate (pydata#3993) WIP: backend interface, now it uses subclassing (pydata#4836) weighted: small improvements (pydata#4818) Update related-projects.rst (pydata#4844) iris update doc url (pydata#4845) Faster unstacking (pydata#4746) ...
2 parents 9ee7c3a + 10f0227 commit b65e579

File tree

117 files changed

+2794
-1578
lines changed

Some content is hidden

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

117 files changed

+2794
-1578
lines changed

.github/ISSUE_TEMPLATE/config.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ contact_links:
44
url: https://github.com/pydata/xarray/discussions
55
about: |
66
Ask questions and discuss with other community members here.
7-
If you have a question like "How do I concatenate a list of datasets?" then
7+
If you have a question like "How do I concatenate a list of datasets?" then
88
please include a self-contained reproducible example if possible.
9-
10-

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
- [ ] Closes #xxxx
44
- [ ] Tests added
5-
- [ ] Passes `isort . && black . && mypy . && flake8`
5+
- [ ] Passes `pre-commit run --all-files`
66
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
77
- [ ] New functions/methods are listed in `api.rst`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Detect CI Trigger
2+
description: |
3+
Detect a keyword used to control the CI in the subject line of a commit message.
4+
inputs:
5+
keyword:
6+
description: |
7+
The keyword to detect.
8+
required: true
9+
outputs:
10+
trigger-found:
11+
description: |
12+
true if the keyword has been found in the subject line of the commit message
13+
value: ${{ steps.detect-trigger.outputs.CI_TRIGGERED }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: detect trigger
18+
id: detect-trigger
19+
run: |
20+
bash $GITHUB_ACTION_PATH/script.sh ${{ github.event_name }} ${{ inputs.keyword }}
21+
shell: bash
22+
- name: show detection result
23+
run: |
24+
echo "::group::final summary"
25+
echo "commit message: ${{ steps.detect-trigger.outputs.COMMIT_MESSAGE }}"
26+
echo "trigger keyword: ${{ inputs.keyword }}"
27+
echo "trigger found: ${{ steps.detect-trigger.outputs.CI_TRIGGERED }}"
28+
echo "::endgroup::"
29+
shell: bash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
event_name="$1"
3+
keyword="$2"
4+
5+
echo "::group::fetch a sufficient number of commits"
6+
echo "skipped"
7+
# git log -n 5 2>&1
8+
# if [[ "$event_name" == "pull_request" ]]; then
9+
# ref=$(git log -1 --format='%H')
10+
# git -c protocol.version=2 fetch --deepen=2 --no-tags --prune --progress -q origin $ref 2>&1
11+
# git log FETCH_HEAD
12+
# git checkout FETCH_HEAD
13+
# else
14+
# echo "nothing to do."
15+
# fi
16+
# git log -n 5 2>&1
17+
echo "::endgroup::"
18+
19+
echo "::group::extracting the commit message"
20+
echo "event name: $event_name"
21+
if [[ "$event_name" == "pull_request" ]]; then
22+
ref="HEAD^2"
23+
else
24+
ref="HEAD"
25+
fi
26+
27+
commit_message="$(git log -n 1 --pretty=format:%s "$ref")"
28+
29+
if [[ $(echo $commit_message | wc -l) -le 1 ]]; then
30+
echo "commit message: '$commit_message'"
31+
else
32+
echo -e "commit message:\n--- start ---\n$commit_message\n--- end ---"
33+
fi
34+
echo "::endgroup::"
35+
36+
echo "::group::scanning for the keyword"
37+
echo "searching for: '$keyword'"
38+
if echo "$commit_message" | grep -qF "$keyword"; then
39+
result="true"
40+
else
41+
result="false"
42+
fi
43+
echo "keyword detected: $result"
44+
echo "::endgroup::"
45+
46+
echo "::set-output name=COMMIT_MESSAGE::$commit_message"
47+
echo "::set-output name=CI_TRIGGERED::$result"

.github/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ limitPerRun: 1 # start with a small number
5656

5757
# issues:
5858
# exemptLabels:
59-
# - confirmed
59+
# - confirmed

.github/workflows/ci-additional.yaml

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: CI Additional
2+
on:
3+
push:
4+
branches:
5+
- "*"
6+
pull_request:
7+
branches:
8+
- "*"
9+
workflow_dispatch: # allows you to trigger manually
10+
11+
jobs:
12+
detect-ci-trigger:
13+
name: detect ci trigger
14+
runs-on: ubuntu-latest
15+
if: github.event_name == 'push' || github.event_name == 'pull_request'
16+
outputs:
17+
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 2
22+
- uses: ./.github/actions/detect-ci-trigger
23+
id: detect-trigger
24+
with:
25+
keyword: "[skip-ci]"
26+
27+
test:
28+
name: ${{ matrix.os }} ${{ matrix.env }}
29+
runs-on: ${{ matrix.os }}
30+
needs: detect-ci-trigger
31+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
32+
defaults:
33+
run:
34+
shell: bash -l {0}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: ["ubuntu-latest"]
39+
env:
40+
[
41+
"py37-bare-minimum",
42+
"py37-min-all-deps",
43+
"py37-min-nep18",
44+
"py38-all-but-dask",
45+
"py38-backend-api-v2",
46+
"py38-flaky",
47+
]
48+
steps:
49+
- name: Cancel previous runs
50+
uses: styfle/[email protected]
51+
with:
52+
access_token: ${{ github.token }}
53+
- uses: actions/checkout@v2
54+
with:
55+
fetch-depth: 0 # Fetch all history for all branches and tags.
56+
57+
- name: Set environment variables
58+
run: |
59+
if [[ ${{ matrix.env }} == "py38-backend-api-v2" ]] ;
60+
then
61+
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
62+
echo "XARRAY_BACKEND_API=v2" >> $GITHUB_ENV
63+
64+
elif [[ ${{ matrix.env }} == "py38-flaky" ]] ;
65+
then
66+
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
67+
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
68+
69+
else
70+
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
71+
fi
72+
- name: Cache conda
73+
uses: actions/cache@v2
74+
with:
75+
path: ~/conda_pkgs_dir
76+
key:
77+
${{ runner.os }}-conda-${{ matrix.env }}-${{
78+
hashFiles('ci/requirements/**.yml') }}
79+
80+
- uses: conda-incubator/setup-miniconda@v2
81+
with:
82+
channels: conda-forge
83+
channel-priority: strict
84+
mamba-version: "*"
85+
activate-environment: xarray-tests
86+
auto-update-conda: false
87+
python-version: 3.8
88+
use-only-tar-bz2: true
89+
90+
- name: Install conda dependencies
91+
run: |
92+
mamba env update -f $CONDA_ENV_FILE
93+
94+
- name: Install xarray
95+
run: |
96+
python -m pip install --no-deps -e .
97+
98+
- name: Version info
99+
run: |
100+
conda info -a
101+
conda list
102+
python xarray/util/print_versions.py
103+
- name: Import xarray
104+
run: |
105+
python -c "import xarray"
106+
- name: Run tests
107+
run: |
108+
python -m pytest -n 4 \
109+
--cov=xarray \
110+
--cov-report=xml \
111+
$PYTEST_EXTRA_FLAGS
112+
113+
- name: Upload code coverage to Codecov
114+
uses: codecov/codecov-action@v1
115+
with:
116+
file: ./coverage.xml
117+
flags: unittests,${{ matrix.env }}
118+
env_vars: RUNNER_OS
119+
name: codecov-umbrella
120+
fail_ci_if_error: false
121+
doctest:
122+
name: Doctests
123+
runs-on: "ubuntu-latest"
124+
defaults:
125+
run:
126+
shell: bash -l {0}
127+
128+
steps:
129+
- name: Cancel previous runs
130+
uses: styfle/[email protected]
131+
with:
132+
access_token: ${{ github.token }}
133+
- uses: actions/checkout@v2
134+
with:
135+
fetch-depth: 0 # Fetch all history for all branches and tags.
136+
- uses: conda-incubator/setup-miniconda@v2
137+
with:
138+
channels: conda-forge
139+
channel-priority: strict
140+
mamba-version: "*"
141+
activate-environment: xarray-tests
142+
auto-update-conda: false
143+
python-version: "3.8"
144+
145+
- name: Install conda dependencies
146+
run: |
147+
mamba env update -f ci/requirements/environment.yml
148+
- name: Install xarray
149+
run: |
150+
python -m pip install --no-deps -e .
151+
- name: Version info
152+
run: |
153+
conda info -a
154+
conda list
155+
python xarray/util/print_versions.py
156+
- name: Run doctests
157+
run: |
158+
python -m pytest --doctest-modules xarray --ignore xarray/tests
159+
160+
min-version-policy:
161+
name: Minimum Version Policy
162+
runs-on: "ubuntu-latest"
163+
needs: detect-ci-trigger
164+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
165+
defaults:
166+
run:
167+
shell: bash -l {0}
168+
169+
steps:
170+
- name: Cancel previous runs
171+
uses: styfle/[email protected]
172+
with:
173+
access_token: ${{ github.token }}
174+
- uses: actions/checkout@v2
175+
with:
176+
fetch-depth: 0 # Fetch all history for all branches and tags.
177+
- uses: conda-incubator/setup-miniconda@v2
178+
with:
179+
channels: conda-forge
180+
channel-priority: strict
181+
mamba-version: "*"
182+
auto-update-conda: false
183+
python-version: "3.8"
184+
185+
- name: minimum versions policy
186+
run: |
187+
mamba install -y pyyaml conda
188+
python ci/min_deps_check.py ci/requirements/py37-bare-minimum.yml
189+
python ci/min_deps_check.py ci/requirements/py37-min-all-deps.yml

.github/workflows/ci-pre-commit.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: linting
2+
3+
on:
4+
push:
5+
branches: "*"
6+
pull_request:
7+
branches: "*"
8+
9+
jobs:
10+
linting:
11+
name: "pre-commit hooks"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-python@v2
16+
- uses: pre-commit/[email protected]

0 commit comments

Comments
 (0)