[Catalog-sig] Stable-releases-only PyPi

Sergey Schetinin sergey at maluke.com
Mon Jul 11 21:56:44 CEST 2011


On 11 July 2011 22:47, Tarek Ziadé <ziade.tarek at gmail.com> wrote:
> On Mon, Jul 11, 2011 at 9:32 PM, Sergey Schetinin <sergey at maluke.com> wrote:
>> On 11 July 2011 22:20, Tarek Ziadé <ziade.tarek at gmail.com> wrote:
>>> On Mon, Jul 11, 2011 at 9:03 PM, Sergey Schetinin <sergey at 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)]

>>>> If there's no guessing and all data is local, how hard can it
>>>> be? I'm not asking anyone to do it, but it does look like it would be
>>>> a simpler, more immediate solution.
>>>
>>> istm that it can be complex to have it working over the mirrors,
>>> unless it's a proxy on client-side.
>>> But then we're closer to a client-side change I guess.
>>
>> Given the existing mirrors infrastructure it is indeed hard. If the
>> mirrors were demoted to just serving downloads and not the index, they
>> could still be used with such an index as-is.
>
> 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.

-- 
http://self.maluke.com/


More information about the Catalog-SIG mailing list