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

Followup from #10040 - Support uv compiled requirements files #10688

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

imajes
Copy link

@imajes imajes commented Sep 27, 2024

Skimming the template to make this a bit easier to understand for maintainers.

This is a replay of PR #10040.

to help out @avilaton, i have....

  • fixed the cause of the Sorbet error
  • incorporated feedback from @RazerM.
  • I also properly updated the patch via rebase to clean up the commit history.

I took note of the refactoring note given some of the duplication between the file and update methods. It's not a bad idea in general to abstract some of that out, however the level of effort there might not be worth it just now -- so I left it as is.

anything else needed to get this landed, @jonjanego / @sachin-sandhu ?

thanks all!

avilaton and others added 19 commits September 27, 2024 14:20
Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
Co-authored-by: skshetry <18718008+skshetry@users.noreply.github.com>
Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
…ater.rb

Co-authored-by: beagold <86345081+beagold@users.noreply.github.com>
…ater.rb

Co-authored-by: beagold <86345081+beagold@users.noreply.github.com>
@imajes imajes requested a review from a team as a code owner September 27, 2024 19:25
def uv_pip_compile_options_from_compiled_file(requirements_file)
options = ["--output-file=#{requirements_file.name}"]

options << "--no-emit-index-url" if requirements_file.content.include?("index-url http")
Copy link

Choose a reason for hiding this comment

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

This would cause dependabot to strip an existing index-url.

see #10040 (comment)

Suggested change
options << "--no-emit-index-url" if requirements_file.content.include?("index-url http")
options << "--emit-index-url" if requirements_file.content.include?("index-url http")

probably needs a test generated with --emit-index-url to make sure dependabot doesn't remove it

Copy link
Author

Choose a reason for hiding this comment

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

ah good catch!

@@ -277,6 +287,32 @@ def run_pip_compile_command(command, fingerprint:)
run_command(command, fingerprint: fingerprint)
end

def uv_pip_compile_options_from_compiled_file(requirements_file)
Copy link

Choose a reason for hiding this comment

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

this implementation needs to be updated to match the one in pip_compile_file_updater.rb

Copy link
Author

Choose a reason for hiding this comment

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

gotcha

@imajes
Copy link
Author

imajes commented Sep 30, 2024

OK, quick update- this isn't going to work as is. There are other bugs in it also, and now taking a deeper look at the way pdm/uv/pip-compile/etc are supported (or not) here, that's showing up a bit more to do. will come back to it shortly. @jonjanego - can you reach out to me please? thanks!

@jonjanego
Copy link
Member

OK, quick update- this isn't going to work as is. There are other bugs in it also, and now taking a deeper look at the way pdm/uv/pip-compile/etc are supported (or not) here, that's showing up a bit more to do. will come back to it shortly. @jonjanego - can you reach out to me please? thanks!

can you email me at jonjanego@github.com - i do not see your email on your profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants