[WIP] pypi: hackety hack

Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
William Woodruff 2023-04-24 17:33:17 -06:00
parent 0316b9659f
commit 48a604e31c
No known key found for this signature in database

View File

@ -217,7 +217,7 @@ module PyPI
ohai "Retrieving PyPI dependencies for \"#{input_packages.join(" ")}\"..." if !print_only && !silent ohai "Retrieving PyPI dependencies for \"#{input_packages.join(" ")}\"..." if !print_only && !silent
command = command =
[Formula["python"].bin/"python3", "-m", "pip", "install", "-q", "--dry-run", "--ignore-installed", "--report", "/dev/stdout", *input_packages.map(&:to_s)] [Formula["python"].bin/"python3", "-m", "pip", "install", "-q", "--dry-run", "--ignore-installed", "--report", "/dev/stdout", *input_packages.map(&:to_s)]
pipgrip_output = Utils.popen_read(*command, env: { "PIP_REQUIRE_VIRTUALENV" => "false" }) pip_output = Utils.popen_read({ "PIP_REQUIRE_VIRTUALENV" => "false" }, *command)
unless $CHILD_STATUS.success? unless $CHILD_STATUS.success?
odie <<~EOS odie <<~EOS
Unable to determine dependencies for "#{input_packages.join(" ")}" because of a failure when running Unable to determine dependencies for "#{input_packages.join(" ")}" because of a failure when running
@ -226,7 +226,7 @@ module PyPI
EOS EOS
end end
found_packages = json_to_packages(JSON.parse(pipgrip_output), main_package, exclude_packages).uniq found_packages = json_to_packages(JSON.parse(pip_output), main_package, exclude_packages).uniq
new_resource_blocks = "" new_resource_blocks = ""
found_packages.sort.each do |package| found_packages.sort.each do |package|