Skip to content

Commit e02b625

Browse files
authored
Merge pull request #5688 from dependabot/jakecoffman/poetry-git
fix Poetry not using system git
2 parents 9ae2fb9 + a97751d commit e02b625

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

python/lib/dependabot/python/file_updater/poetry_file_updater.rb

+5
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ def updated_lockfile_content_for(pyproject_content)
177177
"#{NativeHelpers.python_requirements_path}")
178178
end
179179

180+
# use system git instead of the pure Python dulwich
181+
unless python_version&.start_with?("3.6")
182+
run_poetry_command("pyenv exec poetry config experimental.system-git-client true")
183+
end
184+
180185
run_poetry_command(poetry_update_command)
181186

182187
return File.read("poetry.lock") if File.exist?("poetry.lock")

python/lib/dependabot/python/update_checker/poetry_version_resolver.rb

+11
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class PoetryVersionResolver
2828
'checkout',
2929
'(?<tag>.+?)'
3030
|
31+
Failed to checkout
32+
(?<tag>.+?)
33+
(?<url>.+?).git at '(?<tag>.+?)'
34+
|
3135
...Failedtoclone
3236
(?<url>.+?).gitat'(?<tag>.+?)',
3337
verifyrefexistsonremote)
@@ -78,6 +82,7 @@ def resolvable?(version:)
7882

7983
private
8084

85+
# rubocop:disable Metrics/PerceivedComplexity
8186
def fetch_latest_resolvable_version_string(requirement:)
8287
@latest_resolvable_version_string ||= {}
8388
return @latest_resolvable_version_string[requirement] if @latest_resolvable_version_string.key?(requirement)
@@ -97,6 +102,11 @@ def fetch_latest_resolvable_version_string(requirement:)
97102
)
98103
end
99104

105+
# use system git instead of the pure Python dulwich
106+
unless python_version&.start_with?("3.6")
107+
run_poetry_command("pyenv exec poetry config experimental.system-git-client true")
108+
end
109+
100110
# Shell out to Poetry, which handles everything for us.
101111
run_poetry_command(poetry_update_command)
102112

@@ -113,6 +123,7 @@ def fetch_latest_resolvable_version_string(requirement:)
113123
end
114124
end
115125
end
126+
# rubocop:enable Metrics/PerceivedComplexity
116127

117128
def fetch_version_from_parsed_lockfile(updated_lockfile)
118129
version =

0 commit comments

Comments
 (0)