Skip to content

Commit 1727377

Browse files
committed
Merge branch 'master' into sorted-keys
# Conflicts: # xarray/core/utils.py
2 parents 4f8be16 + 6e14df6 commit 1727377

File tree

199 files changed

+18293
-5448
lines changed

Some content is hidden

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

199 files changed

+18293
-5448
lines changed

.git_archival.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref-names: $Format:%D$

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# reduce the number of merge conflicts
22
doc/whats-new.rst merge=union
3+
# allow installing from git archives
4+
.git_archival.txt export-subst

.github/actions/detect-ci-trigger/action.yaml

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

.github/actions/detect-ci-trigger/script.sh

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

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
# Check for updates once a week
7+
interval: 'weekly'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Cancel
2+
on:
3+
workflow_run:
4+
workflows: ["CI", "CI Additional", "CI Upstream"]
5+
types:
6+
- requested
7+
jobs:
8+
cancel:
9+
name: Cancel previous runs
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'pydata/xarray'
12+
steps:
13+
- uses: styfle/cancel-workflow-action@0.9.0
14+
with:
15+
workflow_id: ${{ github.event.workflow.id }}

.github/workflows/ci-additional.yaml

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ jobs:
1212
detect-ci-trigger:
1313
name: detect ci trigger
1414
runs-on: ubuntu-latest
15-
if: github.event_name == 'push' || github.event_name == 'pull_request'
15+
if: |
16+
github.repository == 'pydata/xarray'
17+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
1618
outputs:
1719
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
1820
steps:
1921
- uses: actions/checkout@v2
2022
with:
2123
fetch-depth: 2
22-
- uses: ./.github/actions/detect-ci-trigger
24+
- uses: xarray-contrib/ci-trigger@v1.1
2325
id: detect-trigger
2426
with:
2527
keyword: "[skip-ci]"
@@ -42,26 +44,16 @@ jobs:
4244
"py37-min-all-deps",
4345
"py37-min-nep18",
4446
"py38-all-but-dask",
45-
"py38-backend-api-v2",
4647
"py38-flaky",
4748
]
4849
steps:
49-
- name: Cancel previous runs
50-
uses: styfle/cancel-workflow-action@0.6.0
51-
with:
52-
access_token: ${{ github.token }}
5350
- uses: actions/checkout@v2
5451
with:
5552
fetch-depth: 0 # Fetch all history for all branches and tags.
5653

5754
- name: Set environment variables
5855
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" ]] ;
56+
if [[ ${{ matrix.env }} == "py38-flaky" ]] ;
6557
then
6658
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
6759
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
@@ -121,17 +113,12 @@ jobs:
121113
doctest:
122114
name: Doctests
123115
runs-on: "ubuntu-latest"
124-
needs: detect-ci-trigger
125-
if: needs.detect-ci-trigger.outputs.triggered == 'false'
116+
if: github.repository == 'pydata/xarray'
126117
defaults:
127118
run:
128119
shell: bash -l {0}
129120

130121
steps:
131-
- name: Cancel previous runs
132-
uses: styfle/cancel-workflow-action@0.6.0
133-
with:
134-
access_token: ${{ github.token }}
135122
- uses: actions/checkout@v2
136123
with:
137124
fetch-depth: 0 # Fetch all history for all branches and tags.
@@ -159,6 +146,46 @@ jobs:
159146
run: |
160147
python -m pytest --doctest-modules xarray --ignore xarray/tests
161148
149+
typing:
150+
name: Type checking (mypy)
151+
runs-on: "ubuntu-latest"
152+
needs: detect-ci-trigger
153+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
154+
defaults:
155+
run:
156+
shell: bash -l {0}
157+
158+
steps:
159+
- uses: actions/checkout@v2
160+
with:
161+
fetch-depth: 0 # Fetch all history for all branches and tags.
162+
- uses: conda-incubator/setup-miniconda@v2
163+
with:
164+
channels: conda-forge
165+
channel-priority: strict
166+
mamba-version: "*"
167+
activate-environment: xarray-tests
168+
auto-update-conda: false
169+
python-version: "3.8"
170+
171+
- name: Install conda dependencies
172+
run: |
173+
mamba env update -f ci/requirements/environment.yml
174+
- name: Install mypy
175+
run: |
176+
mamba install --file ci/requirements/mypy_only
177+
- name: Install xarray
178+
run: |
179+
python -m pip install --no-deps -e .
180+
- name: Version info
181+
run: |
182+
conda info -a
183+
conda list
184+
python xarray/util/print_versions.py
185+
- name: Run mypy
186+
run: |
187+
python -m mypy .
188+
162189
min-version-policy:
163190
name: Minimum Version Policy
164191
runs-on: "ubuntu-latest"
@@ -169,10 +196,6 @@ jobs:
169196
shell: bash -l {0}
170197

171198
steps:
172-
- name: Cancel previous runs
173-
uses: styfle/cancel-workflow-action@0.6.0
174-
with:
175-
access_token: ${{ github.token }}
176199
- uses: actions/checkout@v2
177200
with:
178201
fetch-depth: 0 # Fetch all history for all branches and tags.
@@ -186,6 +209,6 @@ jobs:
186209

187210
- name: minimum versions policy
188211
run: |
189-
mamba install -y pyyaml conda
212+
mamba install -y pyyaml conda python-dateutil
190213
python ci/min_deps_check.py ci/requirements/py37-bare-minimum.yml
191214
python ci/min_deps_check.py ci/requirements/py37-min-all-deps.yml
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "pre-commit autoupdate CI"
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 0" # every Sunday at 00:00 UTC
6+
workflow_dispatch:
7+
8+
9+
jobs:
10+
autoupdate:
11+
name: 'pre-commit autoupdate'
12+
runs-on: ubuntu-latest
13+
if: github.repository == 'pydata/xarray'
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v2
17+
- name: Cache pip and pre-commit
18+
uses: actions/cache@v2
19+
with:
20+
path: |
21+
~/.cache/pre-commit
22+
~/.cache/pip
23+
key: ${{ runner.os }}-pre-commit-autoupdate
24+
- name: setup python
25+
uses: actions/setup-python@v2
26+
- name: upgrade pip
27+
run: python -m pip install --upgrade pip
28+
- name: install dependencies
29+
run: python -m pip install --upgrade pre-commit pyyaml packaging
30+
- name: version info
31+
run: python -m pip list
32+
- name: autoupdate
33+
uses: technote-space/create-pr-action@837dbe469b39f08d416889369a52e2a993625c84
34+
with:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
EXECUTE_COMMANDS: |
37+
python -m pre_commit autoupdate
38+
python .github/workflows/sync_linter_versions.py .pre-commit-config.yaml ci/requirements/mypy_only
39+
COMMIT_MESSAGE: 'pre-commit: autoupdate hook versions'
40+
COMMIT_NAME: 'github-actions[bot]'
41+
COMMIT_EMAIL: 'github-actions[bot]@users.noreply.github.com'
42+
PR_TITLE: 'pre-commit: autoupdate hook versions'
43+
PR_BRANCH_PREFIX: 'pre-commit/'
44+
PR_BRANCH_NAME: 'autoupdate-${PR_ID}'

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
linting:
1111
name: "pre-commit hooks"
1212
runs-on: ubuntu-latest
13+
if: github.repository == 'pydata/xarray'
1314
steps:
1415
- uses: actions/checkout@v2
1516
- uses: actions/setup-python@v2
16-
- uses: pre-commit/action@v2.0.0
17+
- uses: pre-commit/action@v2.0.3

.github/workflows/ci.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ jobs:
1212
detect-ci-trigger:
1313
name: detect ci trigger
1414
runs-on: ubuntu-latest
15-
if: github.event_name == 'push' || github.event_name == 'pull_request'
15+
if: |
16+
github.repository == 'pydata/xarray'
17+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
1618
outputs:
1719
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
1820
steps:
1921
- uses: actions/checkout@v2
2022
with:
2123
fetch-depth: 2
22-
- uses: ./.github/actions/detect-ci-trigger
24+
- uses: xarray-contrib/ci-trigger@v1.1
2325
id: detect-trigger
2426
with:
2527
keyword: "[skip-ci]"
@@ -35,12 +37,8 @@ jobs:
3537
fail-fast: false
3638
matrix:
3739
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
38-
python-version: ["3.7", "3.8"]
40+
python-version: ["3.7", "3.8", "3.9"]
3941
steps:
40-
- name: Cancel previous runs
41-
uses: styfle/cancel-workflow-action@0.6.0
42-
with:
43-
access_token: ${{ github.token }}
4442
- uses: actions/checkout@v2
4543
with:
4644
fetch-depth: 0 # Fetch all history for all branches and tags.

.github/workflows/parse_logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def extract_short_test_summary_info(lines):
1818
)
1919
up_to_section_content = itertools.islice(up_to_start_of_section, 1, None)
2020
section_content = itertools.takewhile(
21-
lambda l: l.startswith("FAILED"), up_to_section_content
21+
lambda l: l.startswith("FAILED") or l.startswith("ERROR"), up_to_section_content
2222
)
2323
content = "\n".join(section_content)
2424

0 commit comments

Comments
 (0)