Skip to content

uv pip compile does not add extra-index-url to the generated output file #1502

@hofrob

Description

@hofrob

I think #1143 was only about parsing it from an existing input file. Running pip-compile will add this flag (and probably others) to the generated output.

While testing uv, I haven't found out how to do this or if it's just missing.

uv

uv pip compile \
    pyproject.toml \
    --output-file requirements.txt \
    --extra-index-url=https://private.example.com/pypi

Generates:

# This file was autogenerated by uv v0.1.2 via the following command:
#    uv pip compile pyproject.toml --output-file requirements.txt --extra-index-url=https://private.example.com/pypi

pip-compile

pip-compile \
    --output-file requirements.txt \
    --extra-index-url=https://private.example.com/pypi

Generates:

#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
#    pip-compile --extra-index-url=https://private.example.com/pypi
#
--extra-index-url https://private.example.com/pypi

Adding --extra-index-url ... to the requirements file would allow one to run uv pip sync requirements.txt without having to add the cli argument.

Metadata

Metadata

Assignees

Labels

compatibilityCompatibility with a specification or another tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions