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

Only call pip compile once #5905

Merged
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 @@ -81,12 +81,6 @@ def compile_new_requirement_files
"#{SharedHelpers.escape_command(version_part)}",
allow_unsafe_shell_command: true
)
# Run pip-compile a second time, without an update argument, to
# ensure it resets the right comments.
run_pip_compile_command(
"pyenv exec pip-compile #{pip_compile_options(filename)} " \
"#{filename}"
)
end

# Remove any .python-version file before parsing the reqs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,17 @@ def fetch_latest_resolvable_version_string(requirement:)
run_pip_compile_command(
"pyenv exec pip-compile -v #{pip_compile_options(filename)} -P #{dependency.name} #{filename}"
)
# Run pip-compile a second time, without an update argument,
# to ensure it handles markers correctly
write_original_manifest_files unless dependency.top_level?

next if dependency.top_level?

# Run pip-compile a second time for transient dependencies
# to make sure we do not update dependencies that are
# superfluous. pip-compile does not detect these when
# updating a specific dependency with the -P option.
# Running pip-compile a second time will automatically remove
# superfluous dependencies. Dependabot then marks those with
# update_not_possible.
write_original_manifest_files
run_pip_compile_command(
"pyenv exec pip-compile #{pip_compile_options(filename)} #{filename}"
)
Expand Down