Skip to content

Use semver to check required_version instead of comparing two strings with != #6063

Closed
@wesleymatosdev

Description

@wesleymatosdev

My plan is to use semver library to achieve so.

The idea is to change

if version != required_version {

including the comparison tools provided by semver.

This will allow complex comparisons such as

required_version = ">=1.2.3, <1.8.0"

instead of only plain files.

I'm willing to work on it, btw.

Opening it as an effort to contribute to turning required_version into a stable flag.

### Tasks
- [x] Add tests for current implementation
- [x] Implement new version with `semver`, making sure it does not break old (current) behavior
- [x] Add "stress test" checking multiple definitions to the value (using fancy operators such as `>`, `>=`, `<`, `<=`, `^`, `8`, `~`, etc.), and ensuring it'll work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions