Skip to content

Add --emit-index-url and --emit-find-links to uv export#18370

Draft
Bradley-McCallion wants to merge 1 commit intoastral-sh:mainfrom
Bradley-McCallion:fix/10008
Draft

Add --emit-index-url and --emit-find-links to uv export#18370
Bradley-McCallion wants to merge 1 commit intoastral-sh:mainfrom
Bradley-McCallion:fix/10008

Conversation

@Bradley-McCallion
Copy link

Closes #10008

Summary

uv export now supports --emit-index-url and --emit-find-links, mirroring the equivalent flags on uv pip compile.

When --emit-index-url is passed, the generated requirements.txt will include --index-url and --extra-index-url directives for any indexes configured in [tool.uv.index]. When --emit-find-links is passed, --find-links entries are included. Neither is emitted by default, preserving existing behavior.

Example output with --emit-index-url:

# This file was autogenerated by uv via the following command:
#    uv export --emit-index-url
--index-url https://pypi.org/simple
--extra-index-url https://download.pytorch.org/whl/cu121

anyio==3.7.0 \
    --hash=sha256:... \
    ...

Test Plan

  • Added requirements_txt_emit_index_url and requirements_txt_emit_extra_index_url integration tests
  • Also tested with a locally built binary

NOTE This is my first time contributing to uv and I am also new to Rust to all feedback very welcome

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit index urls in uv export same way as uv pip compile --emit-index-url

1 participant