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

UV Pip Compile increase test coverage #2

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

albertferras-vrf
Copy link

Changes:

  • New uv_pip_compile_file_updater_spec.rb to test everything that was tested with pip-tool's pip-compile command. Reviewed tests one by one and either deleted them or adapted it. (See notes below)
  • Bump uv to latest version. Tests need minimum 0.2.34 because it adds support for --no-binary
  • New uv_pip_compile_options_from_compiled_file because some options' default are different (--skip-extras, --allow-safe and --emit-build-options). Separate methods make it easier to maintain uv and pipcompile versions.

Notes:
Tests removed:

  • Incompatible versions. These tests used requirements.txt with —resolver legacy which does not apply to uv. Without the legacy resolver override there is no error on pip-compile or uv pip compile.
  • All tests using --resolver options
  • Tests using custom headers that include stuff like make upgrade. These are not relevant for uv pip compile mode
  • Editable dependencies (-e giturl). As of now, uv does not support VCS Urls in editable dependencies. See Support for editable dependencies with URLs astral-sh/uv#5442

Some differences/changes:

  • "Via setup": uv outputs -e . and pip compile -e [file://somepath/dependabot_xxxx] (file://somepath/dependabot_xxxx%60) in the temporary file. The updated requirements.txt does not change though
  • “Unsafe dependencies” (pip and setuptools packages) are removed by pip-compile by default, but on the next major release they will no longer remove those by default (—allow-unsafe as new default). Changed the test to check that uv actually includes setuptools, unlike the current pip-compile. See more at uv pip compile adds setuptools (and pip) to requirements.txt astral-sh/uv#1353

@albertferras-vrf
Copy link
Author

hey @avilaton do you think we can merge this on your dependabot's PR? :)


if (resolver = RESOLVER_REGEX.match(requirements_file.content))
options << "--resolver=#{resolver}"
end
Copy link
Owner

Choose a reason for hiding this comment

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

We are going to get a complain about the class length with this

@avilaton avilaton merged commit 93342d0 into avilaton:patch-1 Aug 21, 2024
4 checks passed
@avilaton
Copy link
Owner

hey @avilaton do you think we can merge this on your dependabot's PR? :)

We should add your comments to the other pr in dependabot

@albertferras-vrf
Copy link
Author

thank you! Yes I already added the comments 👍

@albertferras-vrf albertferras-vrf mentioned this pull request Aug 22, 2024
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.

2 participants