Description
Hello. astropy tests against the dev version of matplotlib by installing git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib (see https://github.com/astropy/astropy/blob/13c4faa2ef41624f0f454f16ded57043c2b1c4ec/tox.ini#L84). Unfortunately, this gives a dev version that is hard to check.
Example log using latest stable: https://github.com/astropy/astropy/runs/1807399647?check_suite_focus=true (Matplotlib: 3.3.4)
Example log using dev: https://github.com/astropy/astropy/runs/1807399544?check_suite_focus=true (Matplotlib: 3.3.2+2259.g30546931d)
As a result, I am not sure how to check if a given Matplotlib version is dev or not:
>>> from packaging.version import Version
>>> stable = Version('3.3.4')
>>> dev = Version('3.3.2+2259.g30546931d')
>>> dev > stable # Expected: True
False
>>> dev.is_devrelease # Expected: True
FalseAny advise would be really appreciated. Thanks!
Activity
anntzer commentedon Feb 1, 2021
likely #18971 will fix that?
pllim commentedon Feb 1, 2021
I hope so!
QuLogic commentedon May 19, 2021
This is because the
v3.3.xbranch was not merged tomasterafter the release. This would probably still be a problem now withsetuptools-scmif that were not done, but it was done fairly quickly after 3.4.2, so is fine right now. However, since we use the post-release version scheme, you don't getis_devrelease == True.QuLogic commentedon May 19, 2021
We may want to switch to
release-branch-semver, which seems automatic while still closer to what we do compared to the defaultguess-next-dev.QuLogic commentedon May 20, 2021
On the call, we decided that it's probably a good idea to switch to this form for 3.5.0/master, but we don't have a strong preference. It would be best to confirm that this works for downstream libraries first. So this would change from:
-
master: 3.4.2.post825+g303873fc65-
v3.4.x: 3.4.2+16.gdcfc7a17a2 <- Note this didn't usesetuptools-scm, but would be a mix of these two things for thev3.5.xbranchto:
-
master: 3.5.0.dev820+g6768ef8c4c.d20210520-
v3.4.x: 3.4.3.dev4+g97f47ba6d8.d20210520This should always satisfy
dev > stableformaster, and I believe alsoversion.is_devrelease.Does that sound good for Astropy, @pllim?
pllim commentedon May 20, 2021
Hello. Thanks for the replies! We don't really use
is_devreleaseattribute. I was just trying that out when>comparison didn't work. We usually use something like this in our tests. This is a very specific example but hopefully the idea comes across:I think the new scheme will work nicely for us. Thanks! 🙇♀️