Skip to content

Dealing with legacy version parsing functionality being removed #631

@hodgestar

Description

@hodgestar

PR #407 dropped LegacyVersion, but at the same time it broke the API of packaging.version.parse in a way that makes it very hard to support parse from both packaging 21 and 22.

In 21 if one called parse("...") it would return LegacyVersion instead of raising an error. So if code wanted to use parse but check that the version was correct it has to check whether the returned type was LegacyVersion.

In 22, LegacyVersion is now gone, and an exception is raised instead.

The deprecations raised for LegacyVersion were only raised when a LegacyVersion was created, so code that called parse and checked the return type didn't raise any warnings.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions