Skip to content

Avoid recommending backwards-incompatible version bumps #162

Closed
@hseg

Description

@hseg

(Cross-posting this from
CycloneDX/cyclonedx-python-lib#775 (comment),
since right after posting it I realized this might be more useful here)

In reading the migration advisory for v2.0.0, I'm struck that it makes
packages depending on serializable more brittle, as they'll only be compatible
with serializable ^>= 2.0.0. In particular, this means that on systems (in my
case, Arch Linux's AUR) packaging serializable and some of its reverse
dependencies, the entire set of packages needs to be updated in lockstep (of
course, some of that fragility is also due to Python not supporting multiple
installed versions of packages and Arch Linux's norms being averse to placing
upper bounds on dependencies).
This is particularly ironic given the context for this change was to make the
packaging situation better (avoiding naming conflicts).

Instead, it might make sense to reword the advisory so it recommends something
like

from importlib.metadata import version
from packaging.Version import Version

match Version(version('py-serializable')):
    case ver if ver < Version('2.0.0'):
        import serializable
    case ver if Version('2.0.0') <= ver < Version('3.0.0'):
        import py_serializable as serializable
    case _:
        throw ImportError("Can't predict py-serializable compatibility")

and similarly for the other changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions