Skip to content

Commit 74568b6

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dev
* upstream/master: (23 commits) combine keep_attrs and combine_attrs in apply_ufunc (pydata#5041) Explained what a deprecation cycle is (pydata#5289) Code cleanup (pydata#5234) FacetGrid docstrings (pydata#5293) Add whats new for dataset interpolation with non-numerics (pydata#5297) Allow dataset interpolation with different datatypes (pydata#5008) Flexible indexes: add Index base class and xindexes properties (pydata#5102) pre-commit: autoupdate hook versions (pydata#5280) convert the examples for apply_ufunc to doctest (pydata#5279) fix the new whatsnew section Ensure `HighLevelGraph` layers are `Layer` instances (pydata#5271) New whatsnew section Release-workflow: Bug fix (pydata#5273) more maintenance on whats-new.rst (pydata#5272) v0.18.0 release highlights (pydata#5266) Fix exception when display_expand_data=False for file-backed array. (pydata#5235) Warn ignored keep attrs (pydata#5265) Disable workflows on forks (pydata#5267) fix the built wheel test (pydata#5270) pypi upload workflow maintenance (pydata#5269) ...
2 parents e94dd47 + 751f76a commit 74568b6

Some content is hidden

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

76 files changed

+1842
-1022
lines changed

.github/workflows/cancel-duplicate-runs.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
cancel:
99
name: Cancel previous runs
1010
runs-on: ubuntu-latest
11+
if: github.repository == 'pydata/xarray'
1112
steps:
1213
- uses: styfle/[email protected]
1314
with:

.github/workflows/ci-additional.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ 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:
@@ -111,6 +113,7 @@ jobs:
111113
doctest:
112114
name: Doctests
113115
runs-on: "ubuntu-latest"
116+
if: github.repository == 'pydata/xarray'
114117
defaults:
115118
run:
116119
shell: bash -l {0}

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

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ 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

.github/workflows/ci.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ 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:

.github/workflows/pypi-release.yaml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build and Upload xarray to PyPI
2+
on:
3+
release:
4+
types:
5+
- published
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build-artifacts:
12+
runs-on: ubuntu-latest
13+
if: github.repository == 'pydata/xarray'
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-python@v2
19+
name: Install Python
20+
with:
21+
python-version: 3.8
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install setuptools setuptools-scm wheel twine check-manifest
27+
28+
- name: Build tarball and wheels
29+
run: |
30+
git clean -xdf
31+
git restore -SW .
32+
python -m build --sdist --wheel .
33+
34+
- name: Check built artifacts
35+
run: |
36+
python -m twine check dist/*
37+
pwd
38+
if [ -f dist/xarray-0.0.0.tar.gz ]; then
39+
echo "❌ INVALID VERSION NUMBER"
40+
exit 1
41+
else
42+
echo "✅ Looks good"
43+
fi
44+
- uses: actions/upload-artifact@v2
45+
with:
46+
name: releases
47+
path: dist
48+
49+
test-built-dist:
50+
needs: build-artifacts
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/setup-python@v2
54+
name: Install Python
55+
with:
56+
python-version: 3.8
57+
- uses: actions/download-artifact@v2
58+
with:
59+
name: releases
60+
path: dist
61+
- name: List contents of built dist
62+
run: |
63+
ls -ltrh
64+
ls -ltrh dist
65+
- name: Publish package to TestPyPI
66+
if: github.event_name == 'push'
67+
uses: pypa/[email protected]
68+
with:
69+
user: __token__
70+
password: ${{ secrets.TESTPYPI_TOKEN }}
71+
repository_url: https://test.pypi.org/legacy/
72+
verbose: true
73+
74+
- name: Check uploaded package
75+
if: github.event_name == 'push'
76+
run: |
77+
sleep 3
78+
python -m pip install --upgrade pip
79+
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade xarray
80+
python -m xarray.util.print_versions
81+
82+
upload-to-pypi:
83+
needs: test-built-dist
84+
if: github.event_name == 'release'
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/download-artifact@v2
88+
with:
89+
name: releases
90+
path: dist
91+
- name: Publish package to PyPI
92+
uses: pypa/[email protected]
93+
with:
94+
user: __token__
95+
password: ${{ secrets.PYPI_TOKEN }}
96+
verbose: true

.github/workflows/upstream-dev-ci.yaml

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
detect-ci-trigger:
1515
name: detect upstream-dev ci trigger
1616
runs-on: ubuntu-latest
17-
if: github.event_name == 'push' || github.event_name == 'pull_request'
17+
if: |
18+
github.repository == 'pydata/xarray'
19+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
1820
outputs:
1921
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2022
steps:
@@ -31,12 +33,8 @@ jobs:
3133
runs-on: ubuntu-latest
3234
needs: detect-ci-trigger
3335
if: |
34-
always()
35-
&& github.repository == 'pydata/xarray'
36-
&& (
3736
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
3837
|| needs.detect-ci-trigger.outputs.triggered == 'true'
39-
)
4038
defaults:
4139
run:
4240
shell: bash -l {0}
@@ -97,9 +95,7 @@ jobs:
9795
name: report
9896
needs: upstream-dev
9997
if: |
100-
always()
101-
&& github.event_name == 'schedule'
102-
&& github.repository == 'pydata/xarray'
98+
github.event_name == 'schedule'
10399
&& needs.upstream-dev.outputs.artifacts_availability == 'true'
104100
runs-on: ubuntu-latest
105101
defaults:

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ repos:
1313
- id: isort
1414
# https://github.com/python/black#version-control-integration
1515
- repo: https://github.com/psf/black
16-
rev: 21.4b2
16+
rev: 21.5b0
1717
hooks:
1818
- id: black
1919
- repo: https://github.com/keewis/blackdoc
2020
rev: v0.3.3
2121
hooks:
2222
- id: blackdoc
2323
- repo: https://gitlab.com/pycqa/flake8
24-
rev: 3.9.1
24+
rev: 3.9.2
2525
hooks:
2626
- id: flake8
2727
# - repo: https://github.com/Carreau/velin

doc/api.rst

+1
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ Faceting
846846
plot.FacetGrid
847847
plot.FacetGrid.add_colorbar
848848
plot.FacetGrid.add_legend
849+
plot.FacetGrid.add_quiverkey
849850
plot.FacetGrid.map
850851
plot.FacetGrid.map_dataarray
851852
plot.FacetGrid.map_dataarray_line

doc/contributing.rst

+27-3
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,34 @@ with ``git commit --no-verify``.
379379
Backwards Compatibility
380380
~~~~~~~~~~~~~~~~~~~~~~~
381381

382-
Please try to maintain backward compatibility. *xarray* has growing number of users with
382+
Please try to maintain backwards compatibility. *xarray* has a growing number of users with
383383
lots of existing code, so don't break it if at all possible. If you think breakage is
384-
required, clearly state why as part of the pull request. Also, be careful when changing
385-
method signatures and add deprecation warnings where needed.
384+
required, clearly state why as part of the pull request.
385+
386+
Be especially careful when changing function and method signatures, because any change
387+
may require a deprecation warning. For example, if your pull request means that the
388+
argument ``old_arg`` to ``func`` is no longer valid, instead of simply raising an error if
389+
a user passes ``old_arg``, we would instead catch it:
390+
391+
.. code-block:: python
392+
393+
def func(new_arg, old_arg=None):
394+
if old_arg is not None:
395+
from warnings import warn
396+
397+
warn(
398+
"`old_arg` has been deprecated, and in the future will raise an error."
399+
"Please use `new_arg` from now on.",
400+
DeprecationWarning,
401+
)
402+
403+
# Still do what the user intended here
404+
405+
This temporary check would then be removed in a subsequent version of xarray.
406+
This process of first warning users before actually breaking their code is known as a
407+
"deprecation cycle", and makes changes significantly easier to handle both for users
408+
of xarray, and for developers of other libraries that depend on xarray.
409+
386410

387411
.. _contributing.ci:
388412

0 commit comments

Comments
 (0)