From f862583630c77cc61a4e588758482ece6b8c6423 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 21:46:32 +0300 Subject: [PATCH 1/7] Increase support windows of dependencies --- ci/min_deps_check.py | 4 ++-- ci/requirements/py36-bare-minimum.yml | 2 +- ci/requirements/py36-min-all-deps.yml | 6 +++--- ci/requirements/py36-min-nep18.yml | 8 ++++---- doc/installing.rst | 7 +++---- requirements.txt | 2 +- setup.cfg | 4 ++-- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index 527093cf5bc..d768630250d 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -23,8 +23,8 @@ "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 has_errors = False diff --git a/ci/requirements/py36-bare-minimum.yml b/ci/requirements/py36-bare-minimum.yml index 00fef672855..30c8d3061fe 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=36.5 diff --git a/ci/requirements/py36-min-all-deps.yml b/ci/requirements/py36-min-all-deps.yml index c11c52bd19f..25815f6ccbf 100644 --- a/ci/requirements/py36-min-all-deps.yml +++ b/ci/requirements/py36-min-all-deps.yml @@ -15,8 +15,8 @@ dependencies: - cfgrib=0.9 - cftime=1.0 - coveralls - - dask=2.9 - - distributed=2.9 + - dask=2.3 + - distributed=2.3 - flake8 - h5netcdf=0.7 - h5py=2.9 # Policy allows for 2.10, but it's a conflict-fest @@ -43,7 +43,7 @@ dependencies: - rasterio=1.0 - scipy=1.3 - seaborn=0.9 - - setuptools=41.2 + - setuptools=36.5 # - 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..f3b42d1bb40 100644 --- a/ci/requirements/py36-min-nep18.yml +++ b/ci/requirements/py36-min-nep18.yml @@ -6,8 +6,8 @@ dependencies: # require drastically newer packages than everything else - python=3.6 - coveralls - - dask=2.9 - - distributed=2.9 + - dask=2.3 + - distributed=2.3 - numpy=1.17 - pandas=0.25 - pint=0.13 @@ -15,6 +15,6 @@ dependencies: - pytest - pytest-cov - pytest-env - - scipy=1.2 - - setuptools=41.2 + - scipy=1.3 + - setuptools=36.5 - sparse=0.8 diff --git a/doc/installing.rst b/doc/installing.rst index a25bf65e342..ae1d7c96346 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -7,7 +7,7 @@ Required dependencies --------------------- - Python (3.6 or later) -- setuptools +- setuptools (36.5 or later) - `numpy `__ (1.15 or later) - `pandas `__ (0.25 or later) @@ -93,16 +93,15 @@ dependencies: - **Python:** 42 months (`NEP-29 `_) +- setuptools: 42 months - **numpy:** 24 months (`NEP-29 `_) -- **pandas:** 12 months -- **scipy:** 12 months - **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/requirements.txt b/requirements.txt index f73887ff5cc..b897949a19e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ numpy >= 1.15 pandas >= 0.25 -setuptools >= 41.2 +setuptools >= 36.5 diff --git a/setup.cfg b/setup.cfg index ad0b12a3e32..eca3c3a1b1a 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 >= 36.5 # For pkg_resources setup_requires = - setuptools >= 41.2 + setuptools >= 36.5 setuptools_scm [options.package_data] From 286fd5dff74400ecb22383a7cafbc13a69be7051 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 21:55:42 +0300 Subject: [PATCH 2/7] what's new --- doc/whats-new.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 2ad2a426532..ce6811061f3 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -29,6 +29,10 @@ 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 and all versions of other packages released + in the last 12 months, both up from 6 months (:issue:`4295`) + `Guido Imperiale `_. Bug fixes From 9dedc5d7353c2f3dd82223feb7496ca5efafa435 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 21:57:30 +0300 Subject: [PATCH 3/7] trivial --- doc/installing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/installing.rst b/doc/installing.rst index ae1d7c96346..c47c554296b 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -93,7 +93,7 @@ dependencies: - **Python:** 42 months (`NEP-29 `_) -- setuptools: 42 months +- **setuptools:** 42 months - **numpy:** 24 months (`NEP-29 `_) - **sparse, pint** and other libraries that rely on From fa43bdbed25197d598058cf4d2d963c7f78e77a6 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 22:35:42 +0300 Subject: [PATCH 4/7] Bump setuptools to 38.4 --- ci/min_deps_check.py | 11 ++++++++++- ci/requirements/py36-bare-minimum.yml | 2 +- ci/requirements/py36-min-all-deps.yml | 2 +- ci/requirements/py36-min-nep18.yml | 2 +- doc/installing.rst | 4 ++-- doc/whats-new.rst | 6 +++--- requirements.txt | 2 +- setup.cfg | 4 ++-- 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index d768630250d..2599c50ad64 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -25,7 +25,11 @@ POLICY_MONTHS = {"python": 42, "numpy": 24, "setuptools": 42} POLICY_MONTHS_DEFAULT = 12 - +# 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. +POLICY_OVERRIDE = {"setuptools": (38, 4)} has_errors = False @@ -151,6 +155,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 30c8d3061fe..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=36.5 + - setuptools=38.4 diff --git a/ci/requirements/py36-min-all-deps.yml b/ci/requirements/py36-min-all-deps.yml index 25815f6ccbf..4945ac18ed8 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=36.5 + - 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 f3b42d1bb40..81754fcfeb1 100644 --- a/ci/requirements/py36-min-nep18.yml +++ b/ci/requirements/py36-min-nep18.yml @@ -16,5 +16,5 @@ dependencies: - pytest-cov - pytest-env - scipy=1.3 - - setuptools=36.5 + - setuptools=38.4 - sparse=0.8 diff --git a/doc/installing.rst b/doc/installing.rst index c47c554296b..e3ac8c52dca 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -7,7 +7,7 @@ Required dependencies --------------------- - Python (3.6 or later) -- setuptools (36.5 or later) +- setuptools (38.4 or later) - `numpy `__ (1.15 or later) - `pandas `__ (0.25 or later) @@ -93,7 +93,7 @@ dependencies: - **Python:** 42 months (`NEP-29 `_) -- **setuptools:** 42 months +- **setuptools:** 42 months (but no older than 38.4) - **numpy:** 24 months (`NEP-29 `_) - **sparse, pint** and other libraries that rely on diff --git a/doc/whats-new.rst b/doc/whats-new.rst index ce6811061f3..15ec6673fb8 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -29,9 +29,9 @@ 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 and all versions of other packages released - in the last 12 months, both up from 6 months (:issue:`4295`) +- Relaxed the :ref:`mindeps_policy` to support all versions of setuptools released in + the last 42 months (but no older than 38.4) and all versions of other packages + released in the last 12 months, both up from 6 months (:issue:`4295`) `Guido Imperiale `_. diff --git a/requirements.txt b/requirements.txt index b897949a19e..3cbeb368c09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ numpy >= 1.15 pandas >= 0.25 -setuptools >= 36.5 +setuptools >= 38.4 diff --git a/setup.cfg b/setup.cfg index eca3c3a1b1a..79cc9acb18d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -76,9 +76,9 @@ python_requires = >=3.6 install_requires = numpy >= 1.15 pandas >= 0.25 - setuptools >= 36.5 # For pkg_resources + setuptools >= 38.4 # For pkg_resources setup_requires = - setuptools >= 36.5 + setuptools >= 38.4 setuptools_scm [options.package_data] From 809f597e1962e516f0060dd83a136ef4d6a49118 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 23:20:25 +0300 Subject: [PATCH 5/7] Bump dask back to 2.9 --- ci/min_deps_check.py | 18 +++++++++++++----- ci/requirements/py36-min-all-deps.yml | 4 ++-- ci/requirements/py36-min-nep18.yml | 4 ++-- doc/installing.rst | 1 + doc/whats-new.rst | 11 ++++++++--- xarray/tests/test_duck_array_ops.py | 5 +++-- 6 files changed, 29 insertions(+), 14 deletions(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index 2599c50ad64..af9bfadeb98 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -25,11 +25,19 @@ POLICY_MONTHS = {"python": 42, "numpy": 24, "setuptools": 42} POLICY_MONTHS_DEFAULT = 12 -# 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. -POLICY_OVERRIDE = {"setuptools": (38, 4)} +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 diff --git a/ci/requirements/py36-min-all-deps.yml b/ci/requirements/py36-min-all-deps.yml index 4945ac18ed8..2a977449033 100644 --- a/ci/requirements/py36-min-all-deps.yml +++ b/ci/requirements/py36-min-all-deps.yml @@ -15,8 +15,8 @@ dependencies: - cfgrib=0.9 - cftime=1.0 - coveralls - - dask=2.3 - - distributed=2.3 + - dask=2.9 + - distributed=2.9 - flake8 - h5netcdf=0.7 - h5py=2.9 # Policy allows for 2.10, but it's a conflict-fest diff --git a/ci/requirements/py36-min-nep18.yml b/ci/requirements/py36-min-nep18.yml index 81754fcfeb1..17aae6932ac 100644 --- a/ci/requirements/py36-min-nep18.yml +++ b/ci/requirements/py36-min-nep18.yml @@ -6,8 +6,8 @@ dependencies: # require drastically newer packages than everything else - python=3.6 - coveralls - - dask=2.3 - - distributed=2.3 + - dask=2.9 + - distributed=2.9 - numpy=1.17 - pandas=0.25 - pint=0.13 diff --git a/doc/installing.rst b/doc/installing.rst index e3ac8c52dca..62e026e20a4 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -96,6 +96,7 @@ dependencies: - **setuptools:** 42 months (but no older than 38.4) - **numpy:** 24 months (`NEP-29 `_) +- **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 diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 15ec6673fb8..4e71e79da20 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -29,9 +29,14 @@ 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) and all versions of other packages - released in the last 12 months, both up from 6 months (:issue:`4295`) +- 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 `_. 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",)) From 3c5ec9e6d409c3c136c2f26f0f1bf117d4a885c6 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 23:20:36 +0300 Subject: [PATCH 6/7] Work around pandas vs sphinx incompatibility --- ci/requirements/doc.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index 6caebc46cdf..e24adddf432 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -17,7 +17,9 @@ dependencies: - netcdf4>=1.5 - numba - numpy>=1.17 - - pandas>=1.0 + # FIXME https://github.com/pydata/xarray/issues/4287 + # - pandas>=1.0 + - pandas=1.0 - rasterio>=1.1 - seaborn - setuptools From 2cc5de970dbb972f192d4c26884cb5ac5c26dc1e Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Sat, 1 Aug 2020 23:27:04 +0300 Subject: [PATCH 7/7] Black --- ci/min_deps_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/min_deps_check.py b/ci/min_deps_check.py index af9bfadeb98..93d12754365 100755 --- a/ci/min_deps_check.py +++ b/ci/min_deps_check.py @@ -36,7 +36,7 @@ # (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) + "setuptools": (38, 4), } has_errors = False