Skip to content

Commit 4e9fa7f

Browse files
committed
Pip: Fix getting the binary and source artifacts
The PyPI JSON API was changed to only include the URLs for the current version on the version specific JSON pages [1]. [1]: pypi/warehouse#11775 Signed-off-by: Martin Nonnenmacher <[email protected]>
1 parent c37961b commit 4e9fa7f

File tree

1 file changed

+1
-13
lines changed
  • analyzer/src/main/kotlin/managers

1 file changed

+1
-13
lines changed

analyzer/src/main/kotlin/managers/Pip.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ class Pip(
177177
"pypi.org",
178178
"pypi.python.org" // Legacy
179179
).flatMap { listOf("--trusted-host", it) }.toTypedArray()
180-
181-
/**
182-
* Return a version string with leading zeros of components stripped.
183-
*/
184-
private fun stripLeadingZerosFromVersion(version: String) =
185-
version.split('.').joinToString(".") { it.trimStart('0').ifEmpty { "0" } }
186180
}
187181

188182
override fun command(workingDir: File?) = "pip"
@@ -569,13 +563,7 @@ class Pip(
569563

570564
val pkgInfo = pkgData["info"]
571565

572-
val pkgRelease = pkgData["releases"]?.let { pkgReleases ->
573-
val pkgVersion = pkgReleases.fieldNames().asSequence().find { version ->
574-
stripLeadingZerosFromVersion(version) == id.version
575-
}
576-
577-
pkgReleases[pkgVersion]
578-
} as? ArrayNode
566+
val pkgRelease = pkgData["urls"] as? ArrayNode
579567

580568
val homepageUrl = pkgInfo["home_page"]?.textValue().orEmpty()
581569
val declaredLicenses = getDeclaredLicenses(pkgInfo)

0 commit comments

Comments
 (0)