[Distutils] distlib - experience using the library

Paul Moore p.f.moore at gmail.com
Mon Oct 29 16:50:23 CET 2012


On 29 October 2012 15:11, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Paul Moore <p.f.moore <at> gmail.com> writes:
>> The version API seems very complex. I was expecting to just do
>> something like Version(string) to get a sortable version object. Given
>> that some of my packages use deliberately non-standard custom versions
>> (2.3.x20121023) that's probably insufficient, but for this application
>> I'm not really interested in validating versions. Using
>
> It's probably the docs that need sorting out. With versions, distutils2 has
> NormalizedVersion which conforms to PEP 386 (though there has been some
> discussion here on changing the ordering of 'dev' w.r.t. other qualifiers).

Yes, I did think it was more likely a documentation question rather
than a functionality question.

> However, any work with existing projects on PyPI means you have to consider
> supporting other versions schemes, so I've added support for:
>
> LegacyVersion - as per setuptools/distribute
> SemanticVersion - as per semver.org
> AdaptiveVersion - tries PEP-386, then the suggestion mechanism for PEP 386,
>                   and then semantic

LegacyVersion did the job fine for me.

> I'm not saying that all these version classes necessarily have to live on, but
> it's useful to have them around at this stage in distlib's development, if
> only for experimenting with.

Agreed. From a user experience point of view, I tend to only care
about the case where I'm dealing with versions created by someone
else, and I really don't care whether those versions are "valid" in
any purist sense, only that nothing I pass in will cause a parse
error, and the resulting version objects order sanely. My perspective
on "sanely" is limited pretty much to release versions, so "any series
of numbers separated by dots orders as if it were a tuple of numbers,
anything with non-numeric data in I don't really care about" covers it
really.

Version semantics is a whole other thread though - I won't say more on
that topic here :-)

Paul.


More information about the Distutils-SIG mailing list