Skip to content
Snippets Groups Projects
Commit cf37ff65 authored by Seeker's avatar Seeker
Browse files

pypi: do not use formula name as PyPI package name

parent cc04f3de
No related branches found
No related tags found
No related merge requests found
...@@ -12,15 +12,12 @@ module PyPI ...@@ -12,15 +12,12 @@ module PyPI
AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST = %w[ AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST = %w[
ansible ansible
ansible@2.8 ansible@2.8
cdk8s
cloudformation-cli cloudformation-cli
diffoscope diffoscope
dxpy dxpy
ipython ipython
molecule molecule
pulumi
salt salt
xonsh
].freeze ].freeze
private_constant :AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST private_constant :AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST
...@@ -67,11 +64,15 @@ module PyPI ...@@ -67,11 +64,15 @@ module PyPI
return return
end end
# PyPI package name isn't always the same as the formula name. Try to infer from the URL. pypi_name = url_to_pypi_package_name formula.stable.url
pypi_name = if formula.stable.url.start_with?(PYTHONHOSTED_URL_PREFIX)
url_to_pypi_package_name formula.stable.url if pypi_name.nil?
else return if ignore_non_pypi_packages
formula.name
odie <<~EOS
Could not infer PyPI package name from URL:
#{Formatter.url(formula.stable.url)}
EOS
end end
version ||= formula.version version ||= formula.version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment