payload: {"action":"created","issue":{"url":"https://api.github.com/repos/renovatebot/renovate/issues/3864","repository_url":"https://api.github.com/repos/renovatebot/renovate","labels_url":"https://api.github.com/repos/renovatebot/renovate/issues/3864/labels{/name}","comments_url":"https://api.github.com/repos/renovatebot/renovate/issues/3864/comments","events_url":"https://api.github.com/repos/renovatebot/renovate/issues/3864/events","html_url":"https://github.com/renovatebot/renovate/issues/3864","id":451107402,"node_id":"MDU6SXNzdWU0NTExMDc0MDI=","number":3864,"title":"Support pypi /simple endpoints not ending on /simple ","user":{"login":"hesstobi","id":929957,"node_id":"MDQ6VXNlcjkyOTk1Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/929957?v=4","gravatar_id":"","url":"https://api.github.com/users/hesstobi","html_url":"https://github.com/hesstobi","followers_url":"https://api.github.com/users/hesstobi/followers","following_url":"https://api.github.com/users/hesstobi/following{/other_user}","gists_url":"https://api.github.com/users/hesstobi/gists{/gist_id}","starred_url":"https://api.github.com/users/hesstobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hesstobi/subscriptions","organizations_url":"https://api.github.com/users/hesstobi/orgs","repos_url":"https://api.github.com/users/hesstobi/repos","events_url":"https://api.github.com/users/hesstobi/events{/privacy}","received_events_url":"https://api.github.com/users/hesstobi/received_events","type":"User","site_admin":false},"labels":[{"id":983368941,"node_id":"MDU6TGFiZWw5ODMzNjg5NDE=","url":"https://api.github.com/repos/renovatebot/renovate/labels/%23python","name":"#python","color":"fbca04","default":false},{"id":502599337,"node_id":"MDU6TGFiZWw1MDI1OTkzMzc=","url":"https://api.github.com/repos/renovatebot/renovate/labels/help%20wanted","name":"help wanted","color":"bfdadc","default":true},{"id":619247401,"node_id":"MDU6TGFiZWw2MTkyNDc0MDE=","url":"https://api.github.com/repos/renovatebot/renovate/labels/needs-requirements","name":"needs-requirements","color":"c5def5","default":false},{"id":619253225,"node_id":"MDU6TGFiZWw2MTkyNTMyMjU=","url":"https://api.github.com/repos/renovatebot/renovate/labels/pri3-normal","name":"pri3-normal","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2019-06-01T17:29:39Z","updated_at":"2019-08-29T07:06:58Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**What would you like Renovate to be able to do?**\r\nI have a private pypi index server which servers only the simple api. But the endpoint is not ending on /simple. Thus renovate currently try the json api on that index server, but this will of course fail. It would be nice if renovate will support also the simple api on such endpoints.\r\n\r\n**Describe the solution you'd like**\r\nhttps://github.com/renovatebot/renovate/blob/11befb119c01e7b3d2f3418afa824dd4ce4c565d/lib/datasource/pypi/index.js#L41\r\n\r\nTo switch betwenn the simple and the json api renovat just look if the `hostUrl` ends with `simple`. It would be more flexible if the type of the api is checked based on the response from the host. \r\n\r\n**Describe alternatives you've considered**\r\nAn alternative solution may be, to add option with list of  urls which should be conconsidered having the simple api.\r\n"},"comment":{"url":"https://api.github.com/repos/renovatebot/renovate/issues/comments/526055344","html_url":"https://github.com/renovatebot/renovate/issues/3864#issuecomment-526055344","issue_url":"https://api.github.com/repos/renovatebot/renovate/issues/3864","id":526055344,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNjA1NTM0NA==","user":{"login":"RmStorm","id":13096654,"node_id":"MDQ6VXNlcjEzMDk2NjU0","avatar_url":"https://avatars3.githubusercontent.com/u/13096654?v=4","gravatar_id":"","url":"https://api.github.com/users/RmStorm","html_url":"https://github.com/RmStorm","followers_url":"https://api.github.com/users/RmStorm/followers","following_url":"https://api.github.com/users/RmStorm/following{/other_user}","gists_url":"https://api.github.com/users/RmStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/RmStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RmStorm/subscriptions","organizations_url":"https://api.github.com/users/RmStorm/orgs","repos_url":"https://api.github.com/users/RmStorm/repos","events_url":"https://api.github.com/users/RmStorm/events{/privacy}","received_events_url":"https://api.github.com/users/RmStorm/received_events","type":"User","site_admin":false},"created_at":"2019-08-29T07:06:58Z","updated_at":"2019-08-29T07:06:58Z","author_association":"CONTRIBUTOR","body":"> I did a closer look how pip is doing it. If I understand it correctly it just uses the simple API for listing packages see https://github.com/pypa/pip/blob/master/docs/html/development/architecture/package-finding.rst.\r\n\r\nI think you're right, it seems that pip relies exclusively on the simple API for downloading installing and listing packages.\r\n\r\n> My servers having urls like `https://example.com/repo/default` and `https://example.com/repo/other`.\r\n> \r\n> It seems there is no standard way to check if there url is providing a json or a simple api. Would be a solution to remove the if/else and request both types and return the one which is found.\r\n> \r\n> ```js\r\n> let [debSimple, debJson] = await Promise.all([getSimpleDependency(lookupName, hostUrl), getDependency(lookupName, hostUrl, compatibility)]);\r\n> \r\n> if (debSimple !== null) {\r\n>       return debSimple;\r\n> }\r\n> \r\n> if (debJson !== null) {\r\n>       return debJson;\r\n> }\r\n> ```\r\n> \r\n> Of course the console warnings should then be move from the `getDependency` function to the `getPkgReleases`\r\n\r\nIf @rarkins agrees I will implement this snippet and make a PR? I do think debSimple and debJson should have their priorities reversed:\r\n```js\r\nlet [debSimple, debJson] = await Promise.all([getSimpleDependency(lookupName, hostUrl), getDependency(lookupName, hostUrl, compatibility)]);\r\n\r\nif (debJson !== null) {\r\n      return debJson;\r\n}\r\n\r\nif (debSimple !== null) {\r\n      return debSimple;\r\n}\r\n\r\nif (debSimple !== null) && (debJson !== null) {\r\n      return null;\r\n}\r\n```\r\ne.g. json should be prioritised if available, not the other way around."}}
other: {"actor":{"display_login":"RmStorm"}}