parse_version post-release tags do not work as expected

Issue #208 duplicate
Guy Rozendorn
created an issue

According to http://packages.python.org/distribute/setuptools.html?highlight=tag:

from pkg_resources import parse_version parse_version('2.1-rc2') < parse_version('2.1') False

but both setuptools 0.6c11 and 0.6c12dev_r88795 show that: In [7]: parse_version('2.1-rc2') < parse_version('2.1') Out[7]: True

So pkg_resources acts the opposite of what the documentation says.

Comments (11)

  1. Hanno Schlichting

    I just tried this with distribute 0.6.14:

    >>> parse_version('2.1-rc2')
    ('00000002', '00000001', '*c', '00000002', '*final')
    
    >>> parse_version('2.1')
    ('00000002', '00000001', '*final')
    
    >>> parse_version('2.1-rc2') < parse_version('2.1')
    True
    

    So this works for me.

  2. Guy Rozendorn reporter
    • changed status to open

    Hanno,

    According to the documentation, '-' is a marker for post releases. so "2.1.-rc1" should be newer to "2.1", so actually it doesn't work in all the versions you tried.

  3. Log in to comment