Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Poetry not using system git #5688

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 so looking forward to dropping 3.6 and then we don't have to maintain these...

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