TST/DEP: set direct requirements on test dependencies with accurate lower bounds#18780
TST/DEP: set direct requirements on test dependencies with accurate lower bounds#18780neutrinoceros wants to merge 4 commits intoastropy:mainfrom
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
b97a493 to
15ff4e7
Compare
|
actually I already figured out some other safe minimal requirements from pytest-astropy in my inquiries so might as well include them too |
3b79e71 to
3c84aa0
Compare
|
This should be stable now. I still want to revisit and see if we actually use everything that got pulled from pytest-astropy. Otherwise I'll use constraints rather than requirements. |
fe27911 to
b9b956d
Compare
| # The base set of test-time dependencies. | ||
| test = [ | ||
| "coverage>=6.4.4", | ||
| "hypothesis>=6.84.0", |
There was a problem hiding this comment.
Why not just put 6.142.4 here? No point forcing an older version and then have to ignore a bunch of warning.
There was a problem hiding this comment.
The problem is that we still get warnings with much more recent versions of hypothesis in the conditions I'm trying to resolve for (--resolution=lowest), so I must conclude that they are a side effect of some other, transitive dependencies that I haven't been able to identify just yet.
| 'ignore:_SixMetaPathImporter\.find_spec\(\) not found; falling back to find_module\(\):ImportWarning', # from hypothesis | ||
| 'ignore:_SixMetaPathImporter\.exec_module\(\) not found; falling back to load_module\(\):ImportWarning', # from prompt-toolkit | ||
| "ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning", | ||
| "ignore: module 'sre_constants' is deprecated:DeprecationWarning", # from matplotlib 3.6.0 via pyparsing 3.0.0 |
There was a problem hiding this comment.
Hmm. Why not pin older matplotlib to older pyparsing?
There was a problem hiding this comment.
we already set a lower bound for matplotlib (3.6.0), which itself has a lower bound for pyparsing, but it points to a version that didn't have wheels for Python 3.11.
We could in principle set our own lower bound on pyparsing via a constraint (not a requirement), but then we'd need to keep it in sync with whatever our current lowest supported versions for Python and matplotlib are. My current solution (exclude building pyparsing from source + ignore deprecation selected warnings) should be at least somewhat easier to maintain, as we don't need to rediscover an oldest working version manually each time we upgrade Python or mpl, but any new warning needing filters will be glaring. The cost is that we might accumulate a couple outdated, unused warning filters with time, but that seems benign to me (and we can always clean them up on our own schedule).
There was a problem hiding this comment.
I thought the whole point of this exercise is to have compatible lower bounds of deps, no?
There was a problem hiding this comment.
Indeed. But we don't have exact control over the majority of our dependencies that are only transitive, nor should we attempt to. We can however instruct the resolver to avoid wasteful builds. Does this make sense ?
There was a problem hiding this comment.
I am not super happy we have to start ignoring random warnings again just because of the new way we do oldest deps, but I would like to hear from other devs as well. Thanks for tackling this! Dependencies are hard to navigate in Python.
There was a problem hiding this comment.
(FWIW I just ran resolution=lowest tests with matplotlib>=3.6 as a constraint on top of everything included here except the warning filters and I didn't observe any improvement)
There was a problem hiding this comment.
"ignore: module 'sre_constants' is deprecated:DeprecationWarning", # from matplotlib 3.6.0 via pyparsing 3.0.0
There was a problem hiding this comment.
Oh yes, well, I'm mostly concerned about collection-time warnings now, as they are completely blocking. Maybe we could move forward with this one first and then drop support for mpl 3.6 in a follow up PR ?
There was a problem hiding this comment.
I think I have a better idea still: the reason for treating warnings as errors is that we want to know when something about our env changes or is about to change. This reason goes away if we get reproducible envs, which is the end goal here. So how about we merge this with the filters, but I also open a subissue for #18783 as reminder that
- we can let warnings be warnings in
oldestdeps - we can remove all filters introduced in this PR once we're there
how does this sound ?
There was a problem hiding this comment.
I opened and linked #18853
hope that satisfies everyone
b9b956d to
88f1cf7
Compare
a1c12c5 to
a211b58
Compare
|
rebased to resolve a merge conflict. |
a211b58 to
081027a
Compare
081027a to
68005a8
Compare
Description
Problem: mindeps testing still runs on the latest version of hypothesis, because it isn't already declared as a direct dependency (instead we rely on the meta-package
pytest-astropyto provide it), and we resolve this test env with--resolution=lowest-direct(I'm actively working on moving to--resolution=lowestbut this will take some work upstream and time).Other test dependencies that we only pull in via
pytest-astropymight also create issues but hypothesis is the one blocker I'm having right now in my trials for--resolution=lowest, because it emits a warning (for which I'm adding a filter here) at collection time.partially address #18783