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 CUSTOM_COMPILE_COMMAND #1527

Closed
raylu opened this issue Feb 16, 2024 · 2 comments
Closed

support CUSTOM_COMPILE_COMMAND #1527

raylu opened this issue Feb 16, 2024 · 2 comments
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality

Comments

@raylu
Copy link

raylu commented Feb 16, 2024

https://github.com/jazzband/pip-tools?tab=readme-ov-file#configuration supports CUSTOM_COMPILE_COMMAND, which replaces the command in the header. this is particularly useful if you use a private repo, because otherwise your header looks like

# This file was autogenerated by uv v0.1.2 via the following command:
#    uv pip compile --extra-index-url https://aws:[suuuuuuuuuuuuuuuuuuuper long password here]@[account].d.codeartifact.us-west-2.amazonaws.com/pypi/shared-packages-pypi/simple requirements.in --output-file requirements.txt

(adding a flag instead of the env var would be nice too)

@zanieb zanieb added compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality labels Feb 16, 2024
@sergei-maertens
Copy link

sergei-maertens commented Feb 22, 2024

+1 from me, we use a multi-environment approach to requirements files and the details are abstracted away in a helper shell script:

export CUSTOM_COMPILE_COMMAND="./bin/compile_dependencies.sh"

This information is now lost.

The output before was:

#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
#    ./bin/compile_dependencies.sh
#

and has now turned into:

# This file was autogenerated by uv via the following command:
#    uv pip compile --output-file requirements/ci.txt requirements/base.txt requirements/test-tools.in

(I am looking if we can simplify this setup with -c options, but back when this was set up that didn't work properly yet)

konstin added a commit that referenced this issue Mar 20, 2024
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

This adds support for `CUSTOM_COMPILE_COMMAND` support to change the
header comment in generated requirements files.

See Issue:  
- #1527 

From [pip-tools docs](https://pip-tools.readthedocs.io/en/latest/):

> You might be wrapping the pip-compile command in another script. To
avoid confusing consumers of your custom script you can override the
update command generated at the top of requirements files by setting the
CUSTOM_COMPILE_COMMAND environment variable.

## Test Plan

<!-- How was it tested? -->

See unit test included

---------

Co-authored-by: konsti <konstin@mailbox.org>
@astrojuanlu
Copy link

Closed in #2554?

@konstin konstin closed this as completed Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants