Skip to content

MNT: declare dependency floors the package can actually run on - #1108

Open
thc1006 wants to merge 1 commit into
RocketPy-Team:developfrom
thc1006:mnt/dependency-floors
Open

MNT: declare dependency floors the package can actually run on#1108
thc1006 wants to merge 1 commit into
RocketPy-Team:developfrom
thc1006:mnt/dependency-floors

Conversation

@thc1006

@thc1006 thc1006 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Addresses #1107. Not Closes, since the keyword only fires when a pull request targets the default branch and this targets develop.

Pull request type

  • Code maintenance (refactoring, formatting, tests)

Current behavior

numpy>=1.13
scipy>=1.0

Neither is true, and pyproject.toml reads this file through dynamic = ["dependencies"], so it is what an installer is told.

SciPy. rocketpy/simulation/monte_carlo.py imports scipy.stats.bootstrap at module level, and the package __init__ reaches that module. The SciPy 1.7.0 release notes are where the function arrives:

scipy.stats.bootstrap has been added to allow estimation of the confidence interval and standard error of a statistic.

So 1.0 through 1.6 satisfy the floor and then fail on import rocketpy, before anything runs.

NumPy. The binding constraint here is a sibling rather than NumPy itself. matplotlib>=3.9.0 is in this same file and requires numpy>=1.23, which I found the direct way:

ImportError: Matplotlib requires numpy>=1.23; you have 1.21.3

That is at 1.21.3, which is where NumPy's own Python 3.10 wheels begin, so the wheel-availability answer is not far enough either.

New behavior

numpy>=1.23  # matplotlib 3.9 requires it
scipy>=1.8   # first to allow numpy 1.23; bootstrap needs 1.7

SciPy is 1.8 rather than 1.7 because the two have to compose: scipy==1.7.2 declares numpy<1.23.0, so pinning 1.7 and asking for numpy 1.23 is unsatisfiable. 1.8.0 raised its cap to <1.25.0.

Both are old. SciPy 1.8.0 is February 2022 and NumPy 1.23.0 June 2022, against a package that already requires Python 3.10.

Breaking change

  • No

It refuses installs that would have failed anyway, earlier and with a message about versions rather than an ImportError.

How this was checked

Installed rather than reasoned about, since the constraint that decided the NumPy floor was not the one I expected:

python 3.10, numpy 1.23.0, scipy 1.8.0 pinned, everything else current

import rocketpy                                   works
tests/unit/simulation + tests/unit/stochastic     162 passed, 5 skipped

And resolved from the file itself, taking the lowest each declaration allows:

uv pip install --resolution=lowest-direct -r requirements.txt
-> numpy 1.23.0, scipy 1.8.0, matplotlib 3.9.0

One thing I found and deliberately left alone

requests, pytz, simplekml and dill carry no floor at all, and under a lowest-version resolution they pick releases that cannot run on Python 3.10:

pytz 2018.3       from collections import Mapping
requests (old)    from collections import MutableMapping

pytz>=2018.4 is the first that imports, if anyone wants the number.

I have not touched them, because that is a different defect. These two lines make a claim that is false; those four make no claim at all, and deciding what they should claim is a policy call rather than a correction. It is also not reachable the way the SciPy one is: an ordinary install takes the newest of an unfloored dependency, whereas a deliberate scipy==1.6 is a thing someone might really have.

`scipy>=1.0` is not true. `monte_carlo.py` imports `scipy.stats.bootstrap` at
module level, and the SciPy 1.7.0 release notes are where that arrives, so
anything from 1.0 to 1.6 satisfies the floor and then fails on `import
rocketpy`.

`numpy>=1.13` is not true either, and the binding constraint turned out to be a
sibling rather than NumPy itself: `matplotlib>=3.9.0` requires `numpy>=1.23`.
SciPy then has to be new enough to allow that, and 1.7.2 caps NumPy at
`<1.23.0`, so 1.8 is the first that composes.

Verified rather than reasoned. On Python 3.10 with numpy 1.23.0 and scipy
1.8.0 pinned and everything else current, `import rocketpy` works and
`tests/unit/simulation` with `tests/unit/stochastic` is 162 passed, 5 skipped.
At numpy 1.21.3, which is where NumPy's own cp310 wheels start, matplotlib
refuses to import.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
@thc1006
thc1006 requested a review from a team as a code owner August 8, 2026 06:45
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.55%. Comparing base (e0ff281) to head (5b91612).
⚠️ Report is 24 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1108      +/-   ##
===========================================
+ Coverage    82.18%   82.55%   +0.37%     
===========================================
  Files          122      128       +6     
  Lines        16355    16555     +200     
===========================================
+ Hits         13441    13667     +226     
+ Misses        2914     2888      -26     

☔ 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.

@thc1006

thc1006 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Heads up on a merge order point, found by merging my open PRs together onto develop rather than testing each on its own base.

This PR and #1054 both raise the numpy floor off the same numpy>=1.13, so they conflict textually in requirements.txt:

develop   numpy>=1.13
#1054     numpy>=1.17   SeedSequence, added in 1.17.0
#1108     numpy>=1.23   matplotlib 3.9 requires it

Whichever lands second hits the conflict. The resolution is to take 1.23, which already covers what #1054 needs, so nothing is lost either way and no code has to change.

I have not rebased either branch, since resolving it now would only move the conflict to whichever of us merges first. Happy to rebase this one onto #1054 if you would rather have it ready to go.

On the combined tree, develop + #1054 + #1102 + #1103 + this, with the floor at 1.23: ruff clean, 2198 passed and 45 skipped.

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.

1 participant