On Mon, Jul 11, 2011 at 9:56 PM, Sergey Schetinin <ser...@maluke.com> wrote: > On 11 July 2011 22:47, Tarek Ziadé <ziade.ta...@gmail.com> wrote: >> On Mon, Jul 11, 2011 at 9:32 PM, Sergey Schetinin <ser...@maluke.com> wrote: >>> On 11 July 2011 22:20, Tarek Ziadé <ziade.ta...@gmail.com> wrote: >>>> On Mon, Jul 11, 2011 at 9:03 PM, Sergey Schetinin <ser...@maluke.com> >>>> wrote: >>>> ... >>>>> >>>>> That webapp (it's not *really* a proxy) took me about two hours total, >>>>> and it has to query pypi, guess what is stable and not, cache the >>>>> results. >>>> >>>> how do you guess it ? that's an interesting part >>> >>> Well, I mentioned it in linked post. Basically at first I was doing just >>> this: >>> >>> _rx_final = re.compile(r'[\d\.]+\Z') >>> >>> def is_final(ver): >>> return bool(_rx_final.match(ver)) >>> >>> But to implement the most-stable filter, I changed it to this: >>> http://pastebin.com/JVVAJ9hE >> >> there must be a bug because all the versions I am trying are marked stable >> (even 'lalala') > > Not a bug. It marks the most stable versions available: > >>>> mark_stable(['lala']) > [('lala', True)] >>>> mark_stable(['lala', '1.0']) > [('lala', False), ('1.0', True)] >>>> mark_stable(['0.1a1']) > [('0.1a1', True)] >>>> mark_stable(['0.1a1', '0.1b1']) > [('0.1a1', False), ('0.1b1', True)] >>>> mark_stable(['0.1a1', '0.1b1', '0.1']) > [('0.1a1', False), ('0.1b1', False), ('0.1', True)]
ah ok :D ... >> >> Yeah, the mirror is standalone or it breaks its intent (being useful >> when PyPI is down) > > It's unfortunate this instability was accepted for granted. Yeah, well we've made a lot of progress with PEP 386 / Metadata 1.2 Right now you can still push projects with a version number being "bazinga-boomya". Try to sort this.. PyPI will reject non-pep 386 versions with the newest metadata 1.2, that's why I am pushing hard on its adoption on client-side because it's a better long term solution. Having to guess if a version is stable or not with a version scheme that's free-form is quite a pain. The short-term fix that works well is to ask people not to push unstable stuff at pypi... people can always pick unstable version on the project website Cheers Tarek -- Tarek Ziadé | http://ziade.org _______________________________________________ Catalog-SIG mailing list Catalog-SIG@python.org http://mail.python.org/mailman/listinfo/catalog-sig