Skip to content

Commit 71d0c88

Browse files
committed
Merge branch 'master' into upstream-dev-ci
2 parents 3f69a24 + 48378c4 commit 71d0c88

File tree

192 files changed

+13884
-5486
lines changed

Some content is hidden

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

192 files changed

+13884
-5486
lines changed

.coveragerc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[run]
22
omit =
3-
xarray/tests/*
4-
xarray/core/dask_array_compat.py
5-
xarray/core/npcompat.py
6-
xarray/core/pdcompat.py
7-
xarray/core/pycompat.py
3+
*/xarray/tests/*
4+
*/xarray/core/dask_array_compat.py
5+
*/xarray/core/npcompat.py
6+
*/xarray/core/pdcompat.py
7+
*/xarray/core/pycompat.py

.deepsource.toml

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

.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/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
blank_issues_enabled: true
1+
blank_issues_enabled: false
22
contact_links:
3-
- name: General Question
4-
url: https://stackoverflow.com/questions/tagged/python-xarray
5-
about: "If you have a question like *How do I append to an xarray.Dataset?* then please ask on Stack Overflow using the #python-xarray tag."
3+
- name: Usage question
4+
url: https://github.com/pydata/xarray/discussions
5+
about: |
6+
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
8+
please include a self-contained reproducible example if possible.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Feel free to remove check-list items aren't relevant to your change -->
22

3-
- [ ] Closes #xxxx
4-
- [ ] Tests added
5-
- [ ] Passes `isort . && black . && mypy . && flake8`
6-
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
7-
- [ ] New functions/methods are listed in `api.rst`
3+
- [ ] Closes #xxxx
4+
- [ ] Tests added
5+
- [ ] Passes `pre-commit run --all-files`
6+
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
7+
- [ ] New functions/methods are listed in `api.rst`

.github/stale.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
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: xarray-contrib/ci-trigger@v1
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/cancel-workflow-action@0.6.0
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/cancel-workflow-action@0.6.0
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+
typing:
161+
name: Type checking (mypy)
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/cancel-workflow-action@0.6.0
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+
activate-environment: xarray-tests
183+
auto-update-conda: false
184+
python-version: "3.8"
185+
186+
- name: Install conda dependencies
187+
run: |
188+
mamba env update -f ci/requirements/environment.yml
189+
- name: Install mypy
190+
run: |
191+
mamba install --file ci/requirements/mypy_only
192+
- name: Install xarray
193+
run: |
194+
python -m pip install --no-deps -e .
195+
- name: Version info
196+
run: |
197+
conda info -a
198+
conda list
199+
python xarray/util/print_versions.py
200+
- name: Run mypy
201+
run: |
202+
python -m mypy xarray
203+
204+
min-version-policy:
205+
name: Minimum Version Policy
206+
runs-on: "ubuntu-latest"
207+
needs: detect-ci-trigger
208+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
209+
defaults:
210+
run:
211+
shell: bash -l {0}
212+
213+
steps:
214+
- name: Cancel previous runs
215+
uses: styfle/cancel-workflow-action@0.6.0
216+
with:
217+
access_token: ${{ github.token }}
218+
- uses: actions/checkout@v2
219+
with:
220+
fetch-depth: 0 # Fetch all history for all branches and tags.
221+
- uses: conda-incubator/setup-miniconda@v2
222+
with:
223+
channels: conda-forge
224+
channel-priority: strict
225+
mamba-version: "*"
226+
auto-update-conda: false
227+
python-version: "3.8"
228+
229+
- name: minimum versions policy
230+
run: |
231+
mamba install -y pyyaml conda python-dateutil
232+
python ci/min_deps_check.py ci/requirements/py37-bare-minimum.yml
233+
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: 16 additions & 0 deletions
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/action@v2.0.0

0 commit comments

Comments
 (0)