Skip to content

Commit ef98c32

Browse files
committed
Merge branch 'master' into datetime64-indexing-fix
2 parents 81a7250 + 66ab0ae commit ef98c32

File tree

119 files changed

+4937
-2879
lines changed

Some content is hidden

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

119 files changed

+4937
-2879
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
repos:
33
# isort should run before black as black sometimes tweaks the isort output
44
- repo: https://github.com/timothycrosley/isort
5-
rev: 5.1.0
5+
rev: 5.4.2
66
hooks:
77
- id: isort
88
# https://github.com/python/black#version-control-integration
9-
- repo: https://github.com/python/black
10-
rev: stable
9+
- repo: https://github.com/psf/black
10+
rev: 20.8b1
1111
hooks:
1212
- id: black
1313
- repo: https://github.com/keewis/blackdoc
14-
rev: stable
14+
rev: v0.1.2
1515
hooks:
1616
- id: blackdoc
1717
- repo: https://gitlab.com/pycqa/flake8
1818
rev: 3.8.3
1919
hooks:
2020
- id: flake8
2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v0.780 # Must match ci/requirements/*.yml
22+
rev: v0.782 # Must match ci/requirements/*.yml
2323
hooks:
2424
- id: mypy
2525
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194

HOW_TO_RELEASE.md

+61-47
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,93 @@
1-
# How to issue an xarray release in 17 easy steps
1+
# How to issue an xarray release in 20 easy steps
22

33
Time required: about an hour.
44

5+
These instructions assume that `upstream` refers to the main repository:
6+
```
7+
$ git remote -v
8+
{...}
9+
upstream https://github.com/pydata/xarray (fetch)
10+
upstream https://github.com/pydata/xarray (push)
11+
```
12+
513
1. Ensure your master branch is synced to upstream:
6-
```
7-
git pull upstream master
8-
```
14+
```sh
15+
git pull upstream master
16+
```
917
2. Get a list of contributors with:
10-
```
18+
```sh
1119
git log "$(git tag --sort="v:refname" | sed -n 'x;$p').." --format=%aN | sort -u | perl -pe 's/\n/$1, /'
1220
```
13-
or by substituting the _previous_ release in:
14-
```
15-
git log v0.X.Y-1.. --format=%aN | sort -u | perl -pe 's/\n/$1, /'
21+
or by substituting the _previous_ release in {0.X.Y-1}:
22+
```sh
23+
git log v{0.X.Y-1}.. --format=%aN | sort -u | perl -pe 's/\n/$1, /'
1624
```
1725
Add these into `whats-new.rst` somewhere :)
18-
3. Look over whats-new.rst and the docs. Make sure "What's New" is complete
19-
(check the date!) and consider adding a brief summary note describing the
20-
release at the top.
26+
3. Write a release summary: ~50 words describing the high level features. This
27+
will be used in the release emails, tweets, GitHub release notes, etc.
28+
4. Look over whats-new.rst and the docs. Make sure "What's New" is complete
29+
(check the date!) and add the release summary at the top.
2130
Things to watch out for:
2231
- Important new features should be highlighted towards the top.
2332
- Function/method references should include links to the API docs.
2433
- Sometimes notes get added in the wrong section of whats-new, typically
2534
due to a bad merge. Check for these before a release by using git diff,
26-
e.g., `git diff v0.X.Y whats-new.rst` where 0.X.Y is the previous
35+
e.g., `git diff v{0.X.Y-1} whats-new.rst` where {0.X.Y-1} is the previous
2736
release.
28-
4. If you have any doubts, run the full test suite one final time!
29-
```
37+
5. If possible, open a PR with the release summary and whatsnew changes.
38+
6. After merging, again ensure your master branch is synced to upstream:
39+
```sh
40+
git pull upstream master
41+
```
42+
7. If you have any doubts, run the full test suite one final time!
43+
```sh
3044
pytest
3145
```
32-
5. Check that the ReadTheDocs build is passing.
33-
6. On the master branch, commit the release in git:
46+
8. Check that the ReadTheDocs build is passing.
47+
9. On the master branch, commit the release in git:
48+
```s
49+
git commit -am 'Release v{0.X.Y}'
3450
```
35-
git commit -am 'Release v0.X.Y'
51+
10. Tag the release:
52+
```sh
53+
git tag -a v{0.X.Y} -m 'v{0.X.Y}'
3654
```
37-
7. Tag the release:
38-
```
39-
git tag -a v0.X.Y -m 'v0.X.Y'
40-
```
41-
8. Build source and binary wheels for pypi:
42-
```
43-
git clean -xdf # this deletes all uncommited changes!
55+
11. Build source and binary wheels for PyPI:
56+
```sh
57+
git clean -xdf # this deletes all uncommitted changes!
4458
python setup.py bdist_wheel sdist
4559
```
46-
9. Use twine to check the package build:
47-
```
48-
twine check dist/xarray-0.X.Y*
60+
12. Use twine to check the package build:
61+
```sh
62+
twine check dist/xarray-{0.X.Y}*
4963
```
50-
10. Use twine to register and upload the release on pypi. Be careful, you can't
64+
13. Use twine to register and upload the release on PyPI. Be careful, you can't
5165
take this back!
52-
```
53-
twine upload dist/xarray-0.X.Y*
66+
```sh
67+
twine upload dist/xarray-{0.X.Y}*
5468
```
5569
You will need to be listed as a package owner at
5670
https://pypi.python.org/pypi/xarray for this to work.
57-
11. Push your changes to master:
58-
```
71+
14. Push your changes to master:
72+
```sh
5973
git push upstream master
6074
git push upstream --tags
6175
```
62-
12. Update the stable branch (used by ReadTheDocs) and switch back to master:
63-
```
76+
15. Update the stable branch (used by ReadTheDocs) and switch back to master:
77+
```sh
6478
git checkout stable
6579
git rebase master
66-
git push upstream stable
80+
git push --force upstream stable
6781
git checkout master
6882
```
6983
It's OK to force push to 'stable' if necessary. (We also update the stable
70-
branch with `git cherrypick` for documentation only fixes that apply the
84+
branch with `git cherry-pick` for documentation only fixes that apply the
7185
current released version.)
72-
13. Add a section for the next release (v.X.Y+1) to doc/whats-new.rst:
86+
16. Add a section for the next release {0.X.Y+1} to doc/whats-new.rst:
7387
```
74-
.. _whats-new.0.X.Y+1:
88+
.. _whats-new.{0.X.Y+1}:
7589
76-
v0.X.Y+1 (unreleased)
90+
v{0.X.Y+1} (unreleased)
7791
---------------------
7892
7993
Breaking changes
@@ -95,20 +109,20 @@ Time required: about an hour.
95109
Internal Changes
96110
~~~~~~~~~~~~~~~~
97111
```
98-
14. Commit your changes and push to master again:
99-
```
112+
17. Commit your changes and push to master again:
113+
```sh
100114
git commit -am 'New whatsnew section'
101115
git push upstream master
102116
```
103117
You're done pushing to master!
104-
15. Issue the release on GitHub. Click on "Draft a new release" at
105-
https://github.com/pydata/xarray/releases. Type in the version number, but
106-
don't bother to describe it -- we maintain that on the docs instead.
107-
16. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
118+
18. Issue the release on GitHub. Click on "Draft a new release" at
119+
https://github.com/pydata/xarray/releases. Type in the version number
120+
and paste the release summary in the notes.
121+
19. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
108122
and switch your new release tag (at the bottom) from "Inactive" to "Active".
109123
It should now build automatically.
110-
17. Issue the release announcement! For bug fix releases, I usually only email
111-
[email protected]. For major/feature releases, I will email a broader
124+
20. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
125+
usually only email [email protected]. For major/feature releases, I will email a broader
112126
list (no more than once every 3-6 months):
113127
114128

ci/min_deps_check.py

+20-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@
2323
"pytest-env",
2424
}
2525

26-
POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12}
27-
POLICY_MONTHS_DEFAULT = 6
28-
26+
POLICY_MONTHS = {"python": 42, "numpy": 24, "setuptools": 42}
27+
POLICY_MONTHS_DEFAULT = 12
28+
POLICY_OVERRIDE = {
29+
# dask < 2.9 has trouble with nan-reductions
30+
# TODO remove this special case and the matching note in installing.rst
31+
# after January 2021.
32+
"dask": (2, 9),
33+
"distributed": (2, 9),
34+
# setuptools-scm doesn't work with setuptools < 36.7 (Nov 2017).
35+
# The conda metadata is malformed for setuptools < 38.4 (Jan 2018)
36+
# (it's missing a timestamp which prevents this tool from working).
37+
# TODO remove this special case and the matching note in installing.rst
38+
# after July 2021.
39+
"setuptools": (38, 4),
40+
}
2941
has_errors = False
3042

3143

@@ -151,6 +163,11 @@ def process_pkg(
151163
policy_minor = minor
152164
policy_published_actual = published
153165

166+
try:
167+
policy_major, policy_minor = POLICY_OVERRIDE[pkg]
168+
except KeyError:
169+
pass
170+
154171
if (req_major, req_minor) < (policy_major, policy_minor):
155172
status = "<"
156173
elif (req_major, req_minor) > (policy_major, policy_minor):

ci/requirements/doc.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,22 @@ dependencies:
1313
- ipython
1414
- iris>=2.3
1515
- jupyter_client
16+
- matplotlib-base=3.3.0
1617
- nbsphinx
1718
- netcdf4>=1.5
1819
- numba
1920
- numpy>=1.17
20-
- pandas>=1.0
21+
# FIXME https://github.com/pydata/xarray/issues/4287
22+
# - pandas>=1.0
23+
- pandas=1.0
2124
- rasterio>=1.1
2225
- seaborn
2326
- setuptools
24-
- sphinx>=2.3
27+
- sphinx=3.2
2528
- sphinx_rtd_theme>=0.4
29+
- sphinx-autosummary-accessors
2630
- zarr>=2.4
31+
- pip
32+
- pip:
33+
# relative to this file. Needs to be editable to be accepted.
34+
- -e ../..

ci/requirements/py36-bare-minimum.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ dependencies:
1010
- pytest-env
1111
- numpy=1.15
1212
- pandas=0.25
13-
- setuptools=41.2
13+
- setuptools=38.4

ci/requirements/py36-min-all-deps.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- isort
2727
- lxml=4.4 # Optional dep of pydap
2828
- matplotlib=3.1
29-
- mypy=0.761 # Must match .pre-commit-config.yaml
29+
- mypy=0.782 # Must match .pre-commit-config.yaml
3030
- nc-time-axis=1.2
3131
- netcdf4=1.4
3232
- numba=0.46
@@ -43,7 +43,7 @@ dependencies:
4343
- rasterio=1.0
4444
- scipy=1.3
4545
- seaborn=0.9
46-
- setuptools=41.2
46+
- setuptools=38.4
4747
# - sparse # See py36-min-nep18.yml
4848
- toolz=0.10
4949
- zarr=2.3

ci/requirements/py36-min-nep18.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ dependencies:
1515
- pytest
1616
- pytest-cov
1717
- pytest-env
18-
- scipy=1.2
19-
- setuptools=41.2
18+
- scipy=1.3
19+
- setuptools=38.4
2020
- sparse=0.8

ci/requirements/py36.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- isort
2323
- lxml # Optional dep of pydap
2424
- matplotlib
25-
- mypy=0.761 # Must match .pre-commit-config.yaml
25+
- mypy=0.782 # Must match .pre-commit-config.yaml
2626
- nc-time-axis
2727
- netcdf4
2828
- numba

ci/requirements/py37-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- isort
2323
- lxml # Optional dep of pydap
2424
- matplotlib
25-
- mypy=0.761 # Must match .pre-commit-config.yaml
25+
- mypy=0.782 # Must match .pre-commit-config.yaml
2626
- nc-time-axis
2727
- netcdf4
2828
- numba

ci/requirements/py37.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- isort
2323
- lxml # Optional dep of pydap
2424
- matplotlib
25-
- mypy=0.761 # Must match .pre-commit-config.yaml
25+
- mypy=0.782 # Must match .pre-commit-config.yaml
2626
- nc-time-axis
2727
- netcdf4
2828
- numba

ci/requirements/py38-all-but-dask.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- isort
2020
- lxml # Optional dep of pydap
2121
- matplotlib
22-
- mypy=0.761 # Must match .pre-commit-config.yaml
22+
- mypy=0.782 # Must match .pre-commit-config.yaml
2323
- nc-time-axis
2424
- netcdf4
2525
- numba

conftest.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def pytest_runtest_setup(item):
2424

2525

2626
@pytest.fixture(autouse=True)
27-
def add_standard_imports(doctest_namespace):
27+
def add_standard_imports(doctest_namespace, tmpdir):
2828
import numpy as np
2929
import pandas as pd
3030

@@ -33,3 +33,9 @@ def add_standard_imports(doctest_namespace):
3333
doctest_namespace["np"] = np
3434
doctest_namespace["pd"] = pd
3535
doctest_namespace["xr"] = xr
36+
37+
# always seed numpy.random to make the examples deterministic
38+
np.random.seed(0)
39+
40+
# always switch to the temporary directory, so files get written there
41+
tmpdir.chdir()

0 commit comments

Comments
 (0)