semvec/pypi-packages huggingface dataset:
polist 0.0.2
polist, partially ordered list
License: MIT
Keywords: data structure list topological sort

polist, partially ordered list
=========

.. sourcecode:: python

    >>> from polist import PartialOrderedList
    >>> p = PartialOrderedList()
    >>> p.append(0, 'A')
    >>> p.append(1, 'B')
    >>> p.append(2, 'A')
    >>> p
    [0, 1, 2]
    >>> assert [0, 1, 2] == p
    >>> assert [2, 1, 0] == p
    >>> assert [0, 2, 1] != p
    >>> assert [1, 0, 2] != p
    >>> assert [1, 2, 0] != p
    >>> assert [2, 0, 1] != p
    
    >>> p = PartialOrderedList()
    >>> p.append(0, 'A')
    >>> p.append(1, 'A')
    >>> p.append(2, 'B')
    >>> p.append(3, 'B')
    >>> p.append(4, 'C')
    >>> p.append(5, 'C')
    >>> p
    [0, 1, 2, 3, 4, 5]
    >>> assert [0, 1, 2, 3, 4, 5] == p
    >>> assert [0, 1, 3, 2, 4, 5] == p
    >>> assert [1, 0, 2, 3, 4, 5] == p
    >>> assert [1, 0, 3, 2, 4, 5] == p
    >>> assert [0, 1, 2, 3, 5, 4] == p
    >>> assert [0, 1, 3, 2, 5, 4] == p
    >>> assert [1, 0, 2, 3, 5, 4] == p
    >>> assert [1, 0, 3, 2, 5, 4] == p
SemVerPy 0.1.0
Bump versions. Semantically.
License: MIT

.. image:: https://travis-ci.org/Dinoshauer/SemVerPy.svg?branch=master :target: https://travis-ci.org/Dinoshauer/SemVerPy
.. image:: https://gemnasium.com/Dinoshauer/SemVerPy.svg?branch=master :target: https://gemnasium.com/Dinoshauer/SemVerPy
.. image:: https://coveralls.io/repos/Dinoshauer/SemVerPy/badge.png?branch=master :target: https://coveralls.io/r/Dinoshauer/SemVerPy

SemVerPy
========

Bumping versions. Semantically.

Usage is pretty simple:

.. code-block:: python

    >>> from semverpy import SemVerPy
    >>> version = SemVerPy('1.0.0')
    >>> version.bump_minor()
    <SemVerPy(1.1.0)>
    >>> str(version)
    '1.1.0'

It also supports comparisons:

.. code-block:: python

    >>> version == SemVerPy('1.1.0')
    True
    >>> version > SemVerPy('1.0.0')
    True
    >>> version > SemVerPy('2.0.0')
    False

When you bump a version, all the smaller version numbers are set to zeroes.

.. code-block:: python

    >>> version.bump_major()
    <SemVerPy(2.0.0)>
    >>> str(version)
    '2.0.0'

You can also define a build number when bumping a version:

.. code-block:: python

    >>> version.bump_minor('buildinfo')
    <SemVerPy(2.1.0-buildinfo)>
    >>> str(version)
    '2.1.0-buildinfo'

Lastly, if you define a partial version, you can be used as a dependency.

.. code-block:: python

    >>> version.satisfies(SemVerPy('2.0'))
    False
    >>> version.satisfies(SemVerPy('2.1'))
    True
    >>> version.satisfies(SemVerPy('2'))
    True
    >>> version == SemVerPy('2.1')
    False