diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb627986e0f..a94a53778ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,16 @@ repos: rev: v2.2.3 hooks: - id: flake8 + # run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194 + # - repo: https://github.com/asottile/pyupgrade + # rev: v1.22.1 + # hooks: + # - id: pyupgrade + # args: + # - "--py3-only" + # # remove on f-strings in Py3.7 + # - "--keep-percent-format" + # - repo: https://github.com/timothycrosley/isort + # rev: 4.3.21-2 + # hooks: + # - id: isort diff --git a/asv_bench/benchmarks/__init__.py b/asv_bench/benchmarks/__init__.py index 2ee5350ba90..ef647c5a74a 100644 --- a/asv_bench/benchmarks/__init__.py +++ b/asv_bench/benchmarks/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import itertools import numpy as np diff --git a/asv_bench/benchmarks/dataarray_missing.py b/asv_bench/benchmarks/dataarray_missing.py index b119d14e73a..9711e2bbcd0 100644 --- a/asv_bench/benchmarks/dataarray_missing.py +++ b/asv_bench/benchmarks/dataarray_missing.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import pandas as pd import xarray as xr diff --git a/asv_bench/benchmarks/dataset_io.py b/asv_bench/benchmarks/dataset_io.py index 1542d2c857a..c1567d0b513 100644 --- a/asv_bench/benchmarks/dataset_io.py +++ b/asv_bench/benchmarks/dataset_io.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import os import numpy as np diff --git a/asv_bench/benchmarks/indexing.py b/asv_bench/benchmarks/indexing.py index c9e367dc696..cd212895d99 100644 --- a/asv_bench/benchmarks/indexing.py +++ b/asv_bench/benchmarks/indexing.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import pandas as pd diff --git a/asv_bench/benchmarks/interp.py b/asv_bench/benchmarks/interp.py index b62717d7ceb..cded900ebbc 100644 --- a/asv_bench/benchmarks/interp.py +++ b/asv_bench/benchmarks/interp.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import pandas as pd diff --git a/asv_bench/benchmarks/reindexing.py b/asv_bench/benchmarks/reindexing.py index ceed186fcc8..fe4fa500c09 100644 --- a/asv_bench/benchmarks/reindexing.py +++ b/asv_bench/benchmarks/reindexing.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import xarray as xr diff --git a/asv_bench/benchmarks/rolling.py b/asv_bench/benchmarks/rolling.py index 268bad7e738..d5426af4aa1 100644 --- a/asv_bench/benchmarks/rolling.py +++ b/asv_bench/benchmarks/rolling.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import pandas as pd diff --git a/asv_bench/benchmarks/unstacking.py b/asv_bench/benchmarks/unstacking.py index 7b529373902..342475b96df 100644 --- a/asv_bench/benchmarks/unstacking.py +++ b/asv_bench/benchmarks/unstacking.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, division, print_function - import numpy as np import xarray as xr diff --git a/doc/conf.py b/doc/conf.py index e181c3e14c2..a80e470af26 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,7 +11,7 @@ # # All configuration values have a default; values that are commented out # serve to show the default. -from __future__ import absolute_import, division, print_function + import datetime import os @@ -262,11 +262,11 @@ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', + # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', + # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - #'preamble': '', + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples diff --git a/doc/gallery/plot_cartopy_facetgrid.py b/doc/gallery/plot_cartopy_facetgrid.py index cfa9d3b07ec..a0afa7ad92e 100644 --- a/doc/gallery/plot_cartopy_facetgrid.py +++ b/doc/gallery/plot_cartopy_facetgrid.py @@ -14,7 +14,6 @@ .. _this discussion: https://github.com/pydata/xarray/issues/1397#issuecomment-299190567 """ # noqa -from __future__ import division import cartopy.crs as ccrs import matplotlib.pyplot as plt diff --git a/setup.cfg b/setup.cfg index 68fc3b6e06c..4bcf979197d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,6 +30,8 @@ exclude= doc [isort] +default_section=THIRDPARTY +known_first_party=xarray multi_line_output=3 include_trailing_comma=True force_grid_wrap=0 diff --git a/versioneer.py b/versioneer.py index ea714e561b7..7b55d5d06cb 100644 --- a/versioneer.py +++ b/versioneer.py @@ -277,7 +277,6 @@ """ -from __future__ import print_function import errno import json