pypi livecheck not working any longer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pypi livecheck not working any longer

Enrico Maria Crisostomo
Hi all,

I was running livecheck a few minutes ago on a bunch of ports of mine and I started getting the same error on all the pythons ones:

    Error: cannot check if [portname] was updated (regex didn't match)

All the ports use pypi so, after a quick search I think livecheck is using by default this regex (see pypi.tcl):

    livecheck.regex {"version": "(.+)",}

on this url:

    if {!$has_homepage || ${livecheck.url} eq ${homepage}} {
    livecheck.url \
        https://pypi.python.org/pypi/${livecheck.name}/json
    }

I manually fetched the livecheck URL and I'm getting a different JSON document structure:

    "releases": {
      "0.0": [],
      "0.1.0": [
        {
          "comment_text": "",
          "digests": {
            "md5": "9c4575f5602de11b9bc8a580922974da",
            "sha256": "04b1fafdcfb9eefa9fe03d4c69c71e6fee6e02a39cf3df92bd1f58bc7eb6a3d2"
          },
          "downloads": -1,
    ...
        }
    ],
    "0.1.1": [
      {
    ...

I also noticed the pypi.org web site has been completely renewed.

If this problem is confirmed, we should update the regex.  And I'm thinking that parsing this document with a regular expression is going to be less robust than it was: the version number is now just a quoted field name.  I wonder whether we could and should properly parse the JSON document here.

Cheers,
--
Enrico
Reply | Threaded
Open this post in threaded view
|

Re: pypi livecheck not working any longer

Ryan Schmidt-24

On Apr 16, 2018, at 15:53, Enrico Maria Crisostomo wrote:

> I was running livecheck a few minutes ago on a bunch of ports of mine and I started getting the same error on all the pythons ones:
>
>    Error: cannot check if [portname] was updated (regex didn't match)

> I also noticed the pypi.org web site has been completely renewed.
>
> If this problem is confirmed, we should update the regex.

https://github.com/macports/macports-ports/commit/58bd00863442dfe8228b5003d5213b00ebded2c7

> And I'm thinking that parsing this document with a regular expression is going to be less robust than it was: the version number is now just a quoted field name.  I wonder whether we could and should properly parse the JSON document here.

Doesn't appear to be needed.

Reply | Threaded
Open this post in threaded view
|

Re: pypi livecheck not working any longer

Enrico Maria Crisostomo

> On 17 Apr 2018, at 01:08, Ryan Schmidt <[hidden email]> wrote:
>
>
> On Apr 16, 2018, at 15:53, Enrico Maria Crisostomo wrote:
>
>> I was running livecheck a few minutes ago on a bunch of ports of mine and I started getting the same error on all the pythons ones:
>>
>>   Error: cannot check if [portname] was updated (regex didn't match)
>
>> I also noticed the pypi.org web site has been completely renewed.
>>
>> If this problem is confirmed, we should update the regex.
>
> https://github.com/macports/macports-ports/commit/58bd00863442dfe8228b5003d5213b00ebded2c7
>
>> And I'm thinking that parsing this document with a regular expression is going to be less robust than it was: the version number is now just a quoted field name.  I wonder whether we could and should properly parse the JSON document here.
>
> Doesn't appear to be needed.
>

Thank you very much Ryan.