MNT: declare dependency floors the package can actually run on - #1108
MNT: declare dependency floors the package can actually run on#1108thc1006 wants to merge 1 commit into
Conversation
`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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
Heads up on a merge order point, found by merging my open PRs together onto This PR and #1054 both raise the numpy floor off the same Whichever lands second hits the conflict. The resolution is to take 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, |
Addresses #1107. Not
Closes, since the keyword only fires when a pull request targets the default branch and this targetsdevelop.Pull request type
Current behavior
Neither is true, and
pyproject.tomlreads this file throughdynamic = ["dependencies"], so it is what an installer is told.SciPy.
rocketpy/simulation/monte_carlo.pyimportsscipy.stats.bootstrapat module level, and the package__init__reaches that module. The SciPy 1.7.0 release notes are where the function arrives: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.0is in this same file and requiresnumpy>=1.23, which I found the direct way: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
SciPy is 1.8 rather than 1.7 because the two have to compose:
scipy==1.7.2declaresnumpy<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
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:
And resolved from the file itself, taking the lowest each declaration allows:
One thing I found and deliberately left alone
requests,pytz,simplekmlanddillcarry no floor at all, and under a lowest-version resolution they pick releases that cannot run on Python 3.10:pytz>=2018.4is 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.6is a thing someone might really have.