diff --git a/python/lib/dependabot/python/file_updater/poetry_file_updater.rb b/python/lib/dependabot/python/file_updater/poetry_file_updater.rb index f7c0e461b9d..9b53ac74e45 100644 --- a/python/lib/dependabot/python/file_updater/poetry_file_updater.rb +++ b/python/lib/dependabot/python/file_updater/poetry_file_updater.rb @@ -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") diff --git a/python/lib/dependabot/python/update_checker/poetry_version_resolver.rb b/python/lib/dependabot/python/update_checker/poetry_version_resolver.rb index 5a973af5c79..acd20b774d5 100644 --- a/python/lib/dependabot/python/update_checker/poetry_version_resolver.rb +++ b/python/lib/dependabot/python/update_checker/poetry_version_resolver.rb @@ -28,6 +28,10 @@ class PoetryVersionResolver 'checkout', '(?.+?)' | + Failed to checkout + (?.+?) + (?.+?).git at '(?.+?)' + | ...Failedtoclone (?.+?).gitat'(?.+?)', verifyrefexistsonremote) @@ -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) @@ -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) @@ -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 =