Skip to content

fix: use minimum version bounds for dependencies instead of exact pins#72

Open
formeo wants to merge 2 commits intodjsilva99:developfrom
formeo:fix-dependency-pinning
Open

fix: use minimum version bounds for dependencies instead of exact pins#72
formeo wants to merge 2 commits intodjsilva99:developfrom
formeo:fix-dependency-pinning

Conversation

@formeo
Copy link
Copy Markdown

@formeo formeo commented Mar 23, 2026

Closes #69

Problem

install_requires pins exact versions (numpy==2.4.2, matplotlib==3.10.8).
For a library this breaks user environments by forcing downgrades or conflicts
with other packages. The user in #69 had their conda environment broken by this.

Fix

Changed == to >= with reasonable lower bounds:

  • numpy>=1.22 (first version to support Python 3.10, which is required
    by the int | float type hints used throughout the codebase)
  • matplotlib>=3.5 (first version compatible with numpy 1.22+)

Also added python_requires='>=3.10' since the code uses union type syntax
(int | float) which was introduced in Python 3.10.

The requirements.txt is left unchanged — exact pins there are fine for
development/CI reproducibility.

Note

While looking at this I noticed packages=['heatrapy'] doesn't include
subpackages (dimension_1, dimension_2, mats, etc.). This means
pip install heatrapy from a wheel/sdist might be missing them. Using
find_packages() would fix this. Happy to open a separate issue/PR for that.

Exact version pins in install_requires break user environments by
forcing downgrades or conflicts. Changed to minimum bounds:
- numpy>=1.22 (Python 3.10+ support)
- matplotlib>=3.5 (numpy 1.22+ compat)

Also added python_requires>=3.10 since the code uses union type
syntax (int | float).

Closes djsilva99#69
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.66%. Comparing base (8097499) to head (49507d1).
⚠️ Report is 1 commits behind head on develop.

@@           Coverage Diff            @@
##           develop      #72   +/-   ##
========================================
  Coverage    70.66%   70.66%           
========================================
  Files           21       21           
  Lines         2335     2335           
========================================
  Hits          1650     1650           
  Misses         685      685           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@djsilva99
Copy link
Copy Markdown
Owner

Nice work on this PR — just one additional suggestion:

  • It would be good to also add upper bounds to dependencies (e.g., numpy<2.0, matplotlib<4.0) to avoid potential breakages from future major releases. This helps keep installations stable until compatibility with newer versions is explicitly verified.

This PR will be merged after making conda work properly for the current heatrapy release, which I am addressing now.

Thanks again for the solid contribution!

@formeo
Copy link
Copy Markdown
Author

formeo commented Mar 31, 2026

Good point! I've added upper bounds.

I went with numpy>=1.22,<3 rather than <2.0 since heatrapy already works with numpy 2.x (the previous
release pinned 2.4.2), so capping at <2.0 would break current users.

Same logic for matplotlib — >=3.5,<4 allows the current 3.10.x while
guarding against a future major release.

@djsilva99 djsilva99 changed the base branch from master to develop March 31, 2026 17:02
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.

Old versions of numpy and matplotlib

2 participants