New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependencies: Bump a few versions, start using version range constraints #1017
Conversation
0511495
to
683b1ed
Compare
ProblemAfter mitigating a few woes, the patch is now down to four failures, related to imgw. I can reproduce them locally by using this command:
The error is: exceptions.ComputeError: strict conversion from `str` to `f64` failed for value(s) ["1835 31"]; if you were trying to cast Utf8 to temporal dtypes, consider using `strptime` Q&A@gutzbenj: Do you think it is related to my version bumps, or do you think it could be unrelated? |
Dear @amotl , looking at the changes I wonder what effect they have as most version constraints are the same as before but some libraries are even more constrained with the lower upper bound. |
The issues with the tests are related to actual issues in the data! |
It will give people installing Wetterdienst as a library much more freedom. Before, we mostly used
It will give everyone more safety even when time progresses, i.e. each version of Wetterdienst will be more likely to work, even in the future, while Dependabot is the driver not to stay in the past for too long. With NumPy and pandas, I was just playing around until I realized I needed to bump duckdb. Both commits can probably be removed again. |
I'm not sure that's the case. When you look at the poetry docs [1] e.g. [1] https://python-poetry.org/docs/dependency-specification/ |
What exactly?
What would |
The constraints that are currently set mostly equal the changes you set. That would equal |
Ah, do you suggest to switch everything over to semver instead? I would be open to, but still do not feel totally convinced and comfortable, and made good experiences with version ranges in the past, that's why I was advocating for them. |
Oh my bad!!! I misread the docs and what I said applies only after 1.0 as it looks. What we have to do is reduce the version constraint to second level e.g. |
This is why I love version ranges, because you can define that "it works" with higher major version numbers like |
With all those special cases which tend to be regularly forgotten, or not at hand at the right time, it is another reason why I prefer the explicit version range notation. |
So, does that mean, the Pint pinning had an issue being restricted to 0.17.X. But for numpy anything in the 1.X.Y should be allowed? Then, for numpy it might just be a wrong translation of the caret pinning over at conda-forge. |
The docs say, the caret pinning preserves the leftmost non-zero value. |
Yes, I think this is correct, and needs to be relaxed.
In theory, but the interdependencies of NumPy with other libraries like pandas and transiently to duckdb are more subtle, and sometimes problems only trip on behalf of a larger application and test cases like we are running here. I think it is safer to explicitly let version combinations be validated by CI, and driven by Dependabot. Once a package is released, we do not have any longer the chance to fiddle with its defined dependencies, and with limiting on the upper bound, we are taking care that a package is sound when being installed, even in the future. This specifically applies to "huge" dependencies with many changes even between their minor releases, like NumPy or pandas. The situation is definitively more relaxed with other packages having a more infrequent release cycle, with less changes. |
According to poetry docs |
webdriver-manager = "^4.0.0" | ||
webdriver-manager = ">=4,<5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me use this as an example to demonstrate why I prefer the version range notation: When version 5
of this package will be released, Dependabot will submit a change to >=4,<6
, and the outcome from CI will immediately tell whether this is good or not. If version 5 works, and just because it is version 5 already, I am trusting their maintainers enough that it will not break during the whole version 5 release cycle.
On the other hand, a "point" bump would raise the lower version bound of this package to ">=5", which is an unneccessary restriction if it still works with version 4, and on the other hand, too dangerous without an upper bound, because nobody knows what version 6 will be all about.
Those thoughts include a series of assumptions and decisions I would like to make individually per dependency. They hopefully outline my thoughts why I am so much in favor of version range notations. Of course, it only explains my thoughts on behalf of a single example, but I am sure you can extrapolate from that.
measurement = ">=3.2,<4" | ||
numpy = ">=1.22,<1.24" | ||
pandas = ">=2,<2.1" | ||
Pint = ">=0.17,<0.23" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it technically works with Pint, because the package is compatible enough, I believe it is the right way to write down dependencies in ranges of version numbers, instead of anything else - modulo exceptions ;].
Only writing >=0.17
would be dangerous, because it is very likely to break until a 1.x
release.
Thanks for adding yet another reason why I don't like the convenience variants for version notations, even if they sound convenient. There are just too many troubles, in past, presence, and future. |
I also wanted to add that the resolver now completes in just a few seconds 💯. I am sure there have been advancements in Poetry to increase performance, but I am equally sure it now has much more headroom with those relaxed constraints. |
Happy merging! 🙂 |
2a95e36
to
e293ba2
Compare
e293ba2
to
3118817
Compare
# FIXME: Deactivated after flaw in data discovered on 2023-09-26 | ||
@pytest.mark.skip(reason="Deactivated after flaw in data discovered on 2023-09-26") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you separately take care about this regression, @gutzbenj?
# FIXME: Deactivated after flaw in data discovered on 2023-09-26 | ||
@pytest.mark.skip(reason="Deactivated after flaw in data discovered on 2023-09-26") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito.
("imgw", "hydrology", {"parameter": "hydrology", "resolution": "daily"}, None), | ||
# FIXME: Deactivated after flaw in data discovered on 2023-09-26 | ||
pytest.param( | ||
"imgw", "hydrology", {"parameter": "hydrology", "resolution": "daily"}, None, marks=pytest.mark.xfail | ||
), | ||
# IMGW Meteorology | ||
("imgw", "meteorology", {"parameter": "climate", "resolution": "daily"}, "249200180"), | ||
pytest.param( | ||
"imgw", "meteorology", {"parameter": "climate", "resolution": "daily"}, "249200180", marks=pytest.mark.xfail | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here.
Hmm. Did you see that one before, @gutzbenj?
I don't think dependency adjustments changed anything significant here. At least, when rolling back the changes outlined below, there are no changes to Before:
Now:
|
However, the Poetry resolver reports this is not ok:
|
Don't know what is going on about Percy. fb26a9f may fix it.
However, installing vanilla |
.github/workflows/install.sh
Outdated
# FIXME: Remove this again. | ||
# Fix dependency woes about percy: AttributeError: module 'percy' has no attribute 'Runner'. | ||
# https://github.com/earthobservations/wetterdienst/pull/1017#issuecomment-1741240635 | ||
# pytest tests/ui/explorer/test_explorer.py -k test_app_layout | ||
pip install "percy>=2" --force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: What's that?
A: It fixes a problem running the "explorer" tests on my machine, and hopefully also on CI. See my report at #1017 (comment) ff.
cache-dependency-path: | | ||
pyproject.toml | ||
poetry.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better safe than sorry. ;]
fb26a9f
to
e43181e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
929fe1b
to
37a2424
Compare
37a2424
to
b235d16
Compare
ProblemOnly on Windows:
References
Fix?poetry run poe fix-percy [tool.poe.tasks]
fix-percy = "python -m pip install 'percy>=2,<3' --force" |
39dc10e
to
f3cedcb
Compare
f3cedcb
to
8df10dc
Compare
This patch has quite a few quirks [1]. Still, a lot of debugging went into it, and it seems to be "right" now, despite including workarounds, so I would like to bring it in, in order to continue with more version bumping. [1]: One of them, I've reported upstream to percy/percy-selenium-python#66. |
Oh my. Tests on Windows fail at the very end with an extraordinarily classic error.
Maybe just a hiccup while acquiring MOSMIX data. Re-running with 🤞. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amotl Let's put trust into this debugging session and apply these pinnings over at conda-forge.
I can do this, but on Monday earliest.
Thanks for all the hard work here!
Did you ever observe such errors revolving around xdist, when running tests on Windows, @gutzbenj?
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1017 +/- ##
==========================================
- Coverage 90.91% 89.69% -1.23%
==========================================
Files 105 103 -2
Lines 8718 9498 +780
Branches 998 1056 +58
==========================================
+ Hits 7926 8519 +593
- Misses 592 766 +174
- Partials 200 213 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
About
Related to GH-1015 and GH-1016, this patch intends to modernize a few dependencies.
Details
I've verified the installation works using this command. I did not run any software tests yet.