pypi livecheck not working any longer

Enrico Maria Crisostomo enrico.m.crisostomo at gmail.com
Mon Apr 16 20:53:17 UTC 2018


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


More information about the macports-dev mailing list