fix: proper p9 version check, support for >0.10 #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As stated in #25,
patchworklib
doesn't currently support the currentplotnine
release.The issue in place arises from the way plotnine's version is checked, since my understanding is that
patchworklib
supportsplotnine
releases starting from0.8
. The next major release (0.9
) made some breaking changes whichpatchworklib
handles by doing a simple string check to ensure whether the version is 0.8 or 0.9 so as to handle the ggplot drawing. This has, however, two unintended consequences:(1) Any
plotnine
release newer than0.9
breakspatchworklib
.(2) Any
plotnine
release with substrings containing0.9
or0.8
(such as a possible0.10.8
, for instance) will match the incorrect version and will be handled in the wrong manner.The fix is pretty trivial, and depends on the
parse_version
function ofpkg_resources
, which is in itself a dependency ofsetuptools
that is already a dependency ofpatchworklib
, so we aren't adding any extra dependencies.Comparisons are now made through the properly parsed versions, and any newer versions of
plotnine
should be handled appropiately now.By the way, thanks for the very useful library!