Coder Social home page Coder Social logo

Comments (4)

rbarrois avatar rbarrois commented on June 30, 2024

Partial versions were only intended as part of the Spec side of things; a Spec should only match a non-partial Version.
It might have worked, but that wasn't expected.

Have you tried using Version.coerce('1') in Spec('>=1,<2')?

from python-semanticversion.

elemental-lf avatar elemental-lf commented on June 30, 2024

Thanks for fast reply. I've adapted my code to use coerce and now everything is working again with 2.8.1. But I still think this is a breaking change as the public interface in 2.6.0 is:

class Version(object):
[...]
    def __init__(self, version_string, partial=False):
        major, minor, patch, prerelease, build = self.parse(version_string, partial)
[...]

So partial is a valid public parameter for the constructor and it's handled by parse accordingly. So intentions are not really relevant I think, the public interface and the behaviour of the code is. And I just found that this usage was even documented in the old README.rst:

In order to define "relaxed" version strings, you must pass in partial=True:
>>> v = semantic_version.Version('0.1', partial=True)
>>> list(v)
[0, 1, None, None, None]

from python-semanticversion.

rbarrois avatar rbarrois commented on June 30, 2024

The usage of partial versions was documented, and is still supported!
It's only the Spec class that wasn't designed to work with a partial version, nor documented as such ;)

from python-semanticversion.

elemental-lf avatar elemental-lf commented on June 30, 2024

Thanks for the clarification. As I've adapted my code and nobody else complained about this particular issue yet I'm going to close it.

from python-semanticversion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.