Skip to content

Commit 1ba2401

Browse files
committed
Fix min_deps_check; revert to support numpy=1.14 and pandas=0.24
Fixes the issue noticed in: pydata#4175 (comment)
1 parent 5121d86 commit 1ba2401

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

ci/min_deps_check.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,22 @@ def process_pkg(
141141
policy_months = POLICY_MONTHS.get(pkg, POLICY_MONTHS_DEFAULT)
142142
policy_published = datetime.now() - timedelta(days=policy_months * 30)
143143

144-
policy_major = req_major
145-
policy_minor = req_minor
146-
policy_published_actual = req_published
147-
for (major, minor), published in reversed(sorted(versions.items())):
148-
if published < policy_published:
149-
break
150-
policy_major = major
151-
policy_minor = minor
152-
policy_published_actual = published
144+
policy_versions = {
145+
version: date for version, date in versions.items() if date < policy_published
146+
}
147+
version_and_date = lambda version: (version, policy_versions[version])
148+
policy_major, policy_minor = max(policy_versions, key=version_and_date)
149+
policy_published_actual = versions[policy_major, policy_minor]
153150

154151
if (req_major, req_minor) < (policy_major, policy_minor):
155152
status = "<"
156153
elif (req_major, req_minor) > (policy_major, policy_minor):
157154
status = "> (!)"
158-
error("Package is too new: " + pkg)
155+
error(
156+
f"Package is too new: {pkg}={req_major}.{req_minor} was "
157+
f"published on {versions[req_major, req_minor]:%Y-%m-%d} "
158+
f"(within the past {policy_months} months)"
159+
)
159160
else:
160161
status = "="
161162

ci/requirements/py36-bare-minimum.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ dependencies:
88
- pytest
99
- pytest-cov
1010
- pytest-env
11-
- numpy=1.15
12-
- pandas=0.25
11+
- numpy=1.14
12+
- pandas=0.24
1313
- setuptools=41.2

ci/requirements/py36-min-all-deps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ dependencies:
3131
- nc-time-axis=1.2
3232
- netcdf4=1.4
3333
- numba=0.44
34-
- numpy=1.15
35-
- pandas=0.25
34+
- numpy=1.14
35+
- pandas=0.24
3636
# - pint # See py36-min-nep18.yml
3737
- pip
3838
- pseudonetcdf=3.0

0 commit comments

Comments
 (0)