Skip to content

Commit b0df4d9

Browse files
authored
Match mypy version between CI and pre-commit hook (#3203)
1 parent 097306b commit b0df4d9

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
hooks:
1212
- id: flake8
1313
- repo: https://github.com/pre-commit/mirrors-mypy
14-
rev: v0.720
14+
rev: v0.720 # Must match ci/requirements/*.yml
1515
hooks:
1616
- id: mypy
1717
# run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194

ci/requirements/py36.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
- pytest-env
1616
- coveralls
1717
- flake8
18+
- mypy==0.720 # Must match .pre-commit-config.yaml
1819
- numpy>=1.12
1920
- pandas>=0.19
2021
- pip
@@ -34,5 +35,4 @@ dependencies:
3435
- iris>=1.10
3536
- pydap
3637
- lxml
37-
- pip:
38-
- mypy==0.711
38+

ci/requirements/py37.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
- pytest-env
1717
- coveralls
1818
- flake8
19+
- mypy==0.720 # Must match .pre-commit-config.yaml
1920
- numpy>=1.12
2021
- pandas>=0.19
2122
- pip
@@ -32,5 +33,4 @@ dependencies:
3233
- lxml
3334
- pydap
3435
- pip:
35-
- mypy==0.650
3636
- numbagg

xarray/core/dataset.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ def __init__(
489489
self._indexes = None # type: Optional[OrderedDict[Any, pd.Index]]
490490

491491
if attrs is not None:
492-
self.attrs = attrs
492+
self._attrs = OrderedDict(attrs)
493+
493494
self._encoding = None # type: Optional[Dict]
494495
self._initialized = True
495496

0 commit comments

Comments
 (0)