Skip to content

Commit

Permalink
Aggregate missing poetry error
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Dec 7, 2022
1 parent b7d4087 commit 8e9c7ba
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def fetch_latest_resolvable_version_string(requirement:)
end

# Shell out to Poetry, which handles everything for us.
run_poetry_command(poetry_update_command)
run_poetry_update_command

updated_lockfile =
if File.exist?("poetry.lock") then File.read("poetry.lock")
Expand Down Expand Up @@ -163,8 +163,11 @@ def handle_poetry_errors(error)

# Using `--lock` avoids doing an install.
# Using `--no-interaction` avoids asking for passwords.
def poetry_update_command
"pyenv exec poetry update #{dependency.name} --lock --no-interaction"
def run_poetry_update_command
run_poetry_command(
"pyenv exec poetry update #{dependency.name} --lock --no-interaction",
fingerprint: "pyenv exec poetry update <dependency_name> --lock --no-interaction"
)
end

def check_original_requirements_resolvable
Expand All @@ -174,7 +177,7 @@ def check_original_requirements_resolvable
SharedHelpers.with_git_configured(credentials: credentials) do
write_temporary_dependency_files(update_pyproject: false)

run_poetry_command(poetry_update_command)
run_poetry_update_command

@original_reqs_resolvable = true
rescue SharedHelpers::HelperSubprocessFailed => e
Expand Down Expand Up @@ -331,7 +334,7 @@ def lockfile
poetry_lock || pyproject_lock
end

def run_poetry_command(command)
def run_poetry_command(command, fingerprint: nil)
start = Time.now
command = SharedHelpers.escape_command(command)
stdout, process = Open3.capture2e(command)
Expand All @@ -345,6 +348,7 @@ def run_poetry_command(command)
message: stdout,
error_context: {
command: command,
fingerprint: fingerprint,
time_taken: time_taken,
process_exit_value: process.to_s
}
Expand Down

0 comments on commit 8e9c7ba

Please sign in to comment.