Skip to content

Complex filters #52

Closed
Closed

Description

@kpcyrd

hi, I'm trying to use python-semver for more complex comparison :)

>>> semver.match('6.2.3', '>=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1')

which should match according to the rules composer does it. This is obviously currently not supported but I would really love it to have a method for something like this :)

Activity

  1. k-bx commented on Mar 30, 2017

    @k-bx
    Contributor

    Hi! You can use a simple Python operators meanwhile to combine comparisons, but I wouldn't mind having a separate API for parsing something like this.

    Care to make a PR?

  2. kpcyrd commented on Mar 30, 2017

    @kpcyrd
    Author

    @k-bx I've hacked together a bunch of code to parse it successfully, I'm trying to clean it up.

    Since you're the author of an semver parser, how should I handle >=6?

    This currently causes an exception because it's not valid semver and I currently translate it to >=6.0.0, which I'm not sure is correct. Do you have an opinion on this?

  3. k-bx commented on Mar 30, 2017

    @k-bx
    Contributor

    Yeah. My opinion is — need to make sure semver code is strictly following semver spec, and having the rest additional functionality kept separate and clearly stating that :)

  4. s-celles commented on May 15, 2018

    @s-celles
    Member

    @kpcyrd maybe you should ask at https://github.com/semver/semver to improve semver specification to add this concept of complex filters.
    When a "standard" will emerge we will happily accept PR about it.

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

    No labels
    No labels

    Type

    No type

    Fields

    SIze

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions