Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase support window of all dependencies #4296

Merged
merged 9 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions ci/min_deps_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/py36-bare-minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dependencies:
- pytest-env
- numpy=1.15
- pandas=0.25
- setuptools=41.2
- setuptools=38.4
2 changes: 1 addition & 1 deletion ci/requirements/py36-min-all-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/requirements/py36-min-nep18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Required dependencies
---------------------

- Python (3.6 or later)
- setuptools
- setuptools (38.4 or later)
- `numpy <http://www.numpy.org/>`__ (1.15 or later)
- `pandas <http://pandas.pydata.org/>`__ (0.25 or later)

Expand Down Expand Up @@ -93,16 +93,16 @@ dependencies:

- **Python:** 42 months
(`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_)
- **setuptools:** 42 months (but no older than 38.4)
- **numpy:** 24 months
(`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_)
- **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 <https://numpy.org/neps/nep-0018-array-function-protocol.html>`_
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
Expand Down
9 changes: 9 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/aaronspring>`_.
- 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 <https://github.com/crusaderky>`_.
- 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`).
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

numpy >= 1.15
pandas >= 0.25
setuptools >= 41.2
setuptools >= 38.4
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions xarray/tests/test_duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
arm_xfail,
assert_array_equal,
has_dask,
has_scipy,
raises_regex,
requires_cftime,
requires_dask,
Expand Down Expand Up @@ -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",))

Expand Down