Skip to content

fix: tighten minimum astropy/numpy/scipy dependency versions#316

Merged
steven-murray merged 2 commits into
mainfrom
fix-286-dependency-versions
Jul 5, 2026
Merged

fix: tighten minimum astropy/numpy/scipy dependency versions#316
steven-murray merged 2 commits into
mainfrom
fix-286-dependency-versions

Conversation

@steven-murray

Copy link
Copy Markdown
Collaborator

Summary

  • The underlying crash reported in [Feature Req] More detailed dependency list #286 ('FlatLambdaCDM' object has no attribute '_nu_info') was already fixed on main by fix: replace deprecated _nu_info with public has_massive_nu API #307, which replaced the private cosmo._nu_info.has_massive_nu access with the public cosmo.has_massive_nu/cosmo.nu_relative_density API.
  • The remaining ask in [Feature Req] More detailed dependency list #286 — a more accurate dependency floor — was not addressed. pyproject.toml still listed numpy>=1.6.2, scipy>=0.12.0, astropy>=1.1, versions that predate this project's requires-python = ">=3.12" by years. Because pip only upgrades a package when the installed version doesn't satisfy the constraint, an environment with an old-but-installed astropy could silently keep it ("Requirement already satisfied") instead of picking a version that actually matches what hmf needs.
  • Bumped the floors to the earliest release of each package that supports Python 3.12: numpy>=1.26, scipy>=1.11, astropy>=6.0. Regenerated uv.lock to match.

Test plan

  • uv run pytest tests/test_growth.py tests/test_transfer.py tests/test_cosmo.py — 64 passed, 1 skipped
  • uv lock regenerates cleanly with no other changes

Fixes #286

The previous floors (numpy>=1.6.2, scipy>=0.12.0, astropy>=1.1) predate
hmf's Python>=3.12 requirement by years. Because these bounds are so
permissive, pip can leave an already-installed but incompatible package
version in place ("Requirement already satisfied") instead of upgrading
it, which is what caused the astropy `_nu_info` AttributeError reported
in #286. Bump the floors to the earliest versions of each package that
actually support Python 3.12.

Fixes #286
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (0cc28ed) to head (6cff360).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #316   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files          26       26           
  Lines        2671     2671           
=======================================
  Hits         2614     2614           
  Misses         57       57           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The changelog is now generated from GitHub Release notes rather than
CHANGELOG.rst, so hand-editing that file is stale/confusing. Add a note
to AGENTS.md so this isn't repeated, plus a CLAUDE.md pointer to it.
@steven-murray
steven-murray enabled auto-merge (squash) July 5, 2026 18:24
@steven-murray
steven-murray merged commit 09606bc into main Jul 5, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Req] More detailed dependency list

1 participant