Skip to content

Commit

Permalink
Merge pull request #5688 from dependabot/jakecoffman/poetry-git
Browse files Browse the repository at this point in the history
fix Poetry not using system git
  • Loading branch information
jakecoffman authored Sep 12, 2022
2 parents 9ae2fb9 + a97751d commit e02b625
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def updated_lockfile_content_for(pyproject_content)
"#{NativeHelpers.python_requirements_path}")
end

# use system git instead of the pure Python dulwich
unless python_version&.start_with?("3.6")
run_poetry_command("pyenv exec poetry config experimental.system-git-client true")
end

run_poetry_command(poetry_update_command)

return File.read("poetry.lock") if File.exist?("poetry.lock")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class PoetryVersionResolver
'checkout',
'(?<tag>.+?)'
|
Failed to checkout
(?<tag>.+?)
(?<url>.+?).git at '(?<tag>.+?)'
|
...Failedtoclone
(?<url>.+?).gitat'(?<tag>.+?)',
verifyrefexistsonremote)
Expand Down Expand Up @@ -78,6 +82,7 @@ def resolvable?(version:)

private

# rubocop:disable Metrics/PerceivedComplexity
def fetch_latest_resolvable_version_string(requirement:)
@latest_resolvable_version_string ||= {}
return @latest_resolvable_version_string[requirement] if @latest_resolvable_version_string.key?(requirement)
Expand All @@ -97,6 +102,11 @@ def fetch_latest_resolvable_version_string(requirement:)
)
end

# use system git instead of the pure Python dulwich
unless python_version&.start_with?("3.6")
run_poetry_command("pyenv exec poetry config experimental.system-git-client true")
end

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

Expand All @@ -113,6 +123,7 @@ def fetch_latest_resolvable_version_string(requirement:)
end
end
end
# rubocop:enable Metrics/PerceivedComplexity

def fetch_version_from_parsed_lockfile(updated_lockfile)
version =
Expand Down

0 comments on commit e02b625

Please sign in to comment.