At 10:34 AM 6/25/2010 +0100, Chris Withers wrote:
Hi All,

Is there any any in setuptools/distutils/anything else that I can use to compare version strings using the same rules as setuptools?

ie: sort the following list of versions:

1.0
2.0dev-r22542-20100623
2.0dev-r22553-20100624
2.0

...etc

http://peak.telecommunity.com/DevCenter/PkgResources#parsing-utilities

from pkg_resources import parse_version

sort(versions, key=parse_version)




cheers,

Chris

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to