diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py
index 527093cf5bc..93d12754365 100755
--- a/ci/min_deps_check.py
+++ b/ci/min_deps_check.py
@@ -23,9 +23,21 @@
"pytest-env",
}
-POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12}
-POLICY_MONTHS_DEFAULT = 6
-
+POLICY_MONTHS = {"python": 42, "numpy": 24, "setuptools": 42}
+POLICY_MONTHS_DEFAULT = 12
+POLICY_OVERRIDE = {
+ # dask < 2.9 has trouble with nan-reductions
+ # TODO remove this special case and the matching note in installing.rst
+ # after January 2021.
+ "dask": (2, 9),
+ "distributed": (2, 9),
+ # setuptools-scm doesn't work with setuptools < 36.7 (Nov 2017).
+ # The conda metadata is malformed for setuptools < 38.4 (Jan 2018)
+ # (it's missing a timestamp which prevents this tool from working).
+ # TODO remove this special case and the matching note in installing.rst
+ # after July 2021.
+ "setuptools": (38, 4),
+}
has_errors = False
@@ -151,6 +163,11 @@ def process_pkg(
policy_minor = minor
policy_published_actual = published
+ try:
+ policy_major, policy_minor = POLICY_OVERRIDE[pkg]
+ except KeyError:
+ pass
+
if (req_major, req_minor) < (policy_major, policy_minor):
status = "<"
elif (req_major, req_minor) > (policy_major, policy_minor):
diff --git a/ci/requirements/py36-bare-minimum.yml b/ci/requirements/py36-bare-minimum.yml
index 00fef672855..aaba5366f67 100644
--- a/ci/requirements/py36-bare-minimum.yml
+++ b/ci/requirements/py36-bare-minimum.yml
@@ -10,4 +10,4 @@ dependencies:
- pytest-env
- numpy=1.15
- pandas=0.25
- - setuptools=41.2
+ - setuptools=38.4
diff --git a/ci/requirements/py36-min-all-deps.yml b/ci/requirements/py36-min-all-deps.yml
index c11c52bd19f..2a977449033 100644
--- a/ci/requirements/py36-min-all-deps.yml
+++ b/ci/requirements/py36-min-all-deps.yml
@@ -43,7 +43,7 @@ dependencies:
- rasterio=1.0
- scipy=1.3
- seaborn=0.9
- - setuptools=41.2
+ - setuptools=38.4
# - sparse # See py36-min-nep18.yml
- toolz=0.10
- zarr=2.3
diff --git a/ci/requirements/py36-min-nep18.yml b/ci/requirements/py36-min-nep18.yml
index a9f12abfeae..17aae6932ac 100644
--- a/ci/requirements/py36-min-nep18.yml
+++ b/ci/requirements/py36-min-nep18.yml
@@ -15,6 +15,6 @@ dependencies:
- pytest
- pytest-cov
- pytest-env
- - scipy=1.2
- - setuptools=41.2
+ - scipy=1.3
+ - setuptools=38.4
- sparse=0.8
diff --git a/doc/installing.rst b/doc/installing.rst
index a25bf65e342..62e026e20a4 100644
--- a/doc/installing.rst
+++ b/doc/installing.rst
@@ -7,7 +7,7 @@ Required dependencies
---------------------
- Python (3.6 or later)
-- setuptools
+- setuptools (38.4 or later)
- `numpy `__ (1.15 or later)
- `pandas `__ (0.25 or later)
@@ -93,16 +93,16 @@ dependencies:
- **Python:** 42 months
(`NEP-29 `_)
+- **setuptools:** 42 months (but no older than 38.4)
- **numpy:** 24 months
(`NEP-29 `_)
-- **pandas:** 12 months
-- **scipy:** 12 months
+- **dask and dask.distributed:** 12 months (but no older than 2.9)
- **sparse, pint** and other libraries that rely on
`NEP-18 `_
for integration: very latest available versions only, until the technology will have
matured. This extends to dask when used in conjunction with any of these libraries.
numpy >=1.17.
-- **all other libraries:** 6 months
+- **all other libraries:** 12 months
The above should be interpreted as *the minor version (X.Y) initially published no more
than N months ago*. Patch versions (x.y.Z) are not pinned, and only the latest available
diff --git a/doc/whats-new.rst b/doc/whats-new.rst
index 9d4261da2dd..f31fcc1001e 100644
--- a/doc/whats-new.rst
+++ b/doc/whats-new.rst
@@ -32,6 +32,15 @@ New Features
property for :py:class:`CFTimeIndex` and show ``calendar`` and ``length`` in
:py:meth:`CFTimeIndex.__repr__` (:issue:`2416`, :pull:`4092`)
`Aaron Spring `_.
+- Relaxed the :ref:`mindeps_policy` to support:
+
+ - all versions of setuptools released in the last 42 months (but no older than 38.4)
+ - all versions of dask and dask.distributed released in the last 12 months (but no
+ older than 2.9)
+ - all versions of other packages released in the last 12 months
+
+ All are up from 6 months (:issue:`4295`)
+ `Guido Imperiale `_.
- Use a wrapped array's ``_repr_inline_`` method to construct the collapsed ``repr``
of :py:class:`DataArray` and :py:class:`Dataset` objects and
document the new method in :doc:`internals`. (:pull:`4248`).
diff --git a/requirements.txt b/requirements.txt
index f73887ff5cc..3cbeb368c09 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,4 +4,4 @@
numpy >= 1.15
pandas >= 0.25
-setuptools >= 41.2
+setuptools >= 38.4
diff --git a/setup.cfg b/setup.cfg
index 03f79c736c0..93d55cbca75 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -76,9 +76,9 @@ python_requires = >=3.6
install_requires =
numpy >= 1.15
pandas >= 0.25
- setuptools >= 41.2 # For pkg_resources
+ setuptools >= 38.4 # For pkg_resources
setup_requires =
- setuptools >= 41.2
+ setuptools >= 38.4
setuptools_scm
[options.package_data]
diff --git a/xarray/tests/test_duck_array_ops.py b/xarray/tests/test_duck_array_ops.py
index feedcd27164..e467629a0b3 100644
--- a/xarray/tests/test_duck_array_ops.py
+++ b/xarray/tests/test_duck_array_ops.py
@@ -33,6 +33,7 @@
arm_xfail,
assert_array_equal,
has_dask,
+ has_scipy,
raises_regex,
requires_cftime,
requires_dask,
@@ -767,8 +768,8 @@ def test_timedelta_to_numeric(td):
@pytest.mark.parametrize("use_dask", [True, False])
@pytest.mark.parametrize("skipna", [True, False])
def test_least_squares(use_dask, skipna):
- if use_dask and not has_dask:
- pytest.skip("requires dask")
+ if use_dask and (not has_dask or not has_scipy):
+ pytest.skip("requires dask and scipy")
lhs = np.array([[1, 2], [1, 2], [3, 2]])
rhs = DataArray(np.array([3, 5, 7]), dims=("y",))