From f242ef1256fa14ccb25f59a953923429b37ba1fd Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Mon, 10 Dec 2018 09:19:29 +0100 Subject: [PATCH] refactor: centralize pypi manual source urls --- lib/datasource/index.js | 4 ++++ lib/datasource/pypi.js | 6 ------ test/datasource/__snapshots__/pypi.spec.js.snap | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/datasource/index.js b/lib/datasource/index.js index 73bf6d18be..69b85c1f8f 100644 --- a/lib/datasource/index.js +++ b/lib/datasource/index.js @@ -63,6 +63,10 @@ const manualSourceUrls = { nvm: { node: 'https://github.com/nodejs/node', }, + pypi: { + mkdocs: 'https://github.com/mkdocs/mkdocs', + pillow: 'https://github.com/python-pillow/Pillow', + }, }; async function getPkgReleases(purlStr, config) { diff --git a/lib/datasource/pypi.js b/lib/datasource/pypi.js index e265b9237d..470d555d0f 100644 --- a/lib/datasource/pypi.js +++ b/lib/datasource/pypi.js @@ -78,12 +78,6 @@ async function getDependency(depName, hostUrl, compatibility) { dependency.homepage = dep.info.home_page; } } - const manualRepositories = { - mkdocs: 'https://github.com/mkdocs/mkdocs', - pillow: 'https://github.com/python-pillow/Pillow', - }; - dependency.sourceUrl = - dependency.sourceUrl || manualRepositories[depName.toLowerCase()]; dependency.releases = []; if (dep.releases) { const versions = compatibleVersions(dep.releases, compatibility); diff --git a/test/datasource/__snapshots__/pypi.spec.js.snap b/test/datasource/__snapshots__/pypi.spec.js.snap index dbce0914d6..b96bd0c29f 100644 --- a/test/datasource/__snapshots__/pypi.spec.js.snap +++ b/test/datasource/__snapshots__/pypi.spec.js.snap @@ -112,7 +112,6 @@ Object { "version": "0.31.0", }, ], - "sourceUrl": undefined, } `; @@ -120,7 +119,6 @@ exports[`datasource/pypi getPkgReleases returns non-github home_page 1`] = ` Object { "homepage": "https://microsoft.com", "releases": Array [], - "sourceUrl": undefined, } `; -- GitLab