Skip to content

Commit

Permalink
bump min deps (#7300)
Browse files Browse the repository at this point in the history
* bump min deps

* improve min_deps_check

- better error summary
- fix too-new-warning

* bump netcdf version

* remove outdated comment

* update comments

* update docs
  • Loading branch information
jhamman authored Nov 19, 2022
1 parent c86ffea commit 63a69fe
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 30 deletions.
23 changes: 14 additions & 9 deletions ci/min_deps_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
POLICY_MONTHS = {"python": 24, "numpy": 18}
POLICY_MONTHS_DEFAULT = 12
POLICY_OVERRIDE: Dict[str, Tuple[int, int]] = {}
has_errors = False
errors = []


def error(msg: str) -> None:
global has_errors
has_errors = True
global errors
errors.append(msg)
print("ERROR:", msg)


Expand All @@ -48,7 +48,7 @@ def parse_requirements(fname) -> Iterator[Tuple[str, int, int, Optional[int]]]:
Yield (package name, major version, minor version, [patch version])
"""
global has_errors
global errors

with open(fname) as fh:
contents = yaml.safe_load(fh)
Expand Down Expand Up @@ -157,9 +157,9 @@ def process_pkg(
status = "> (!)"
delta = relativedelta(datetime.now(), policy_published_actual).normalized()
n_months = delta.years * 12 + delta.months
error(
f"Package is too new: {pkg}={req_major}.{req_minor} was "
f"published on {versions[req_major, req_minor]:%Y-%m-%d} "
warning(
f"Package is too new: {pkg}={policy_major}.{policy_minor} was "
f"published on {versions[policy_major, policy_minor]:%Y-%m-%d} "
f"which was {n_months} months ago (policy is {policy_months} months)"
)
else:
Expand Down Expand Up @@ -193,13 +193,18 @@ def main() -> None:
for pkg, major, minor, patch in parse_requirements(fname)
]

print("Package Required Policy Status")
print("\nPackage Required Policy Status")
print("----------------- -------------------- -------------------- ------")
fmt = "{:17} {:7} ({:10}) {:7} ({:10}) {}"
for row in rows:
print(fmt.format(*row))

assert not has_errors
if errors:
print("\nErrors:")
print("-------")
for i, e in enumerate(errors):
print(f"{i+1}. {e}")
sys.exit(1)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/bare-minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ dependencies:
- pytest-env
- pytest-xdist
- numpy=1.20
- packaging=21.0
- packaging=21.3
- pandas=1.3
31 changes: 15 additions & 16 deletions ci/requirements/min-all-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,39 @@ dependencies:
# When upgrading python, numpy, or pandas, must also change
# doc/user-guide/installing.rst, doc/user-guide/plotting.rst and setup.py.
- python=3.8
- boto3=1.18
- boto3=1.20
- bottleneck=1.3
- cartopy=0.19
- cartopy=0.20
- cdms2=3.1
- cfgrib=0.9
- cftime=1.5
- coveralls
- dask-core=2021.09
- distributed=2021.09
- dask-core=2021.11
- distributed=2021.11
- flox=0.5
- h5netcdf=0.11
# h5py and hdf5 tend to cause conflicrs
# h5py and hdf5 tend to cause conflicts
# for e.g. hdf5 1.12 conflicts with h5py=3.1
# prioritize bumping other packages instead
- h5py=3.1
- hdf5=1.10
- h5py=3.6
- hdf5=1.12
- hypothesis
- iris=3.1
- lxml=4.6 # Optional dep of pydap
- matplotlib-base=3.4
- nc-time-axis=1.3
- matplotlib-base=3.5
- nc-time-axis=1.4
# netcdf follows a 1.major.minor[.patch] convention
# (see https://github.com/Unidata/netcdf4-python/issues/1090)
# bumping the netCDF4 version is currently blocked by #4491
- netcdf4=1.5.3
- netcdf4=1.5.7
- numba=0.54
- numpy=1.20
- packaging=21.0
- packaging=21.3
- pandas=1.3
- pint=0.17
- pint=0.18
- pip
- pseudonetcdf=3.1
- pseudonetcdf=3.2
- pydap=3.2
# - pynio=1.5.5
# - pynio=1.5.5 # see: https://github.com/pydata/xarray/issues/4491
- pytest
- pytest-cov
- pytest-env
Expand All @@ -51,7 +50,7 @@ dependencies:
- seaborn=0.11
- sparse=0.13
- toolz=0.11
- typing_extensions=3.10
- typing_extensions=4.0
- zarr=2.10
- pip:
- numbagg==0.1
2 changes: 1 addition & 1 deletion doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Required dependencies

- Python (3.8 or later)
- `numpy <https://www.numpy.org/>`__ (1.20 or later)
- `packaging <https://packaging.pypa.io/en/latest/#>`__ (21.0 or later)
- `packaging <https://packaging.pypa.io/en/latest/#>`__ (21.3 or later)
- `pandas <https://pandas.pydata.org/>`__ (1.3 or later)

.. _optional-dependencies:
Expand Down
21 changes: 20 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ New Features
Breaking changes
~~~~~~~~~~~~~~~~

- The minimum versions of some dependencies were changed (:pull:`7300`):

========================== ========= ========
Package Old New
========================== ========= ========
boto 1.18 1.20
cartopy 0.19 0.20
distributed 2021.09 2021.11
dask 2021.09 2021.11
h5py 3.1 3.6
hdf5 1.10 1.12
matplotlib-base 3.4 3.5
nc-time-axis 1.3 1.4
netcdf4 1.5.3 1.5.7
packaging 20.3 21.3
pint 0.17 0.18
pseudonetcdf 3.1 3.2
typing_extensions 3.10 4.0
========================== ========= ========

Deprecations
~~~~~~~~~~~~
Expand Down Expand Up @@ -2571,7 +2590,7 @@ Breaking changes
have removed the internal use of the ``OrderedDict`` in favor of Python's builtin
``dict`` object which is now ordered itself. This change will be most obvious when
interacting with the ``attrs`` property on Dataset and DataArray objects.
(:issue:`3380`, :pull:`3389`). By `Joe Hamman <https://github.com/jhamman>`_.
(:issue:`3380`, :pull:`3389`). HBy `Joeamman <https://github.com/jhamman>`_.

New functions/methods
~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# https://help.github.com/en/github/visualizing-repository-data-with-graphs/listing-the-packages-that-a-repository-depends-on

numpy >= 1.20
packaging >= 21.0
packaging >= 21.3
pandas >= 1.3
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ python_requires = >=3.8
install_requires =
numpy >= 1.20 # recommended to use >= 1.22 for full quantile method support
pandas >= 1.3
packaging >= 21.0
packaging >= 21.3

[options.extras_require]
io =
Expand Down

0 comments on commit 63a69fe

Please sign in to comment.