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

Support uv compiled requirements files #10040

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Update pip_compile_version_resolver.rb
  • Loading branch information
avilaton authored Sep 12, 2024
commit 39cc41ea1a47dd9d177bec4e8f5524a0981b66e2
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,14 @@ def pip_compile_options(filename)
options << "--output-file=#{requirements_file.name}"
end

command = "pyenv exec pip-compile"
if (requirements_file = compiled_file_for_filename(filename)) &&
requirements_file.content.include?("uv pip compile")
command = "pyenv exec uv pip compile"
if (requirements_file = compiled_file_for_filename(filename))
if requirements_file.content.include?("uv pip compile")
options += uv_pip_compile_options_from_compiled_file(requirements_file)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @avilaton , looks like you added 2 new functions uv_pip_compile_options_from_compiled_file , pip_compile_options_from_compiled_file in pip_compile_version_resolver.rb, i think they are being referenced from pip_compile_file_updater.rb can you please fix this (IDE is showing it as no function exists in Dependabot::Python::UpdateChecker::PipCompileVersionResolver)

Copy link
Author

Choose a reason for hiding this comment

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

Would be neat to have a way not to repeat this code, it seems to me as if it would be more resilient to have them centralized. What do you suggest we should do?

Copy link
Contributor

Choose a reason for hiding this comment

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

@avilaton , if you think we might benefit from moving them to new location/class and see a additional functionality that could be used across. please do so.

command = "pyenv exec uv pip compile"
else
options += pip_compile_options_from_compiled_file(requirements_file)
Copy link
Contributor

Choose a reason for hiding this comment

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

@avilaton , same as above

command = "pyenv exec pip-compile"
end
end

[options.join(" "), command]
Expand Down
Loading