pypi: allow source wheels as resources
Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
parent
e56fde6584
commit
547e33ccb7
@ -73,12 +73,22 @@ module PyPI
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
sdist = json["urls"].find { |url| url["packagetype"] == "sdist" }
|
dist = json["urls"].find do |url|
|
||||||
return if sdist.nil?
|
url["packagetype"] == "sdist"
|
||||||
|
end
|
||||||
|
|
||||||
|
# If there isn't an sdist, we use the first source wheel.
|
||||||
|
if dist.nil?
|
||||||
|
dist = json["urls"].find do |url|
|
||||||
|
url["filename"].end_with?("-none-any.whl")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return if dist.nil?
|
||||||
|
|
||||||
@pypi_info = [
|
@pypi_info = [
|
||||||
PyPI.normalize_python_package(json["info"]["name"]), sdist["url"],
|
PyPI.normalize_python_package(json["info"]["name"]), dist["url"],
|
||||||
sdist["digests"]["sha256"], json["info"]["version"]
|
dist["digests"]["sha256"], json["info"]["version"]
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user