Pip-tools: Start CUSTOM_COMPILE_COMMAND instead of pip-compile itself

Created on 7 May 2020  路  11Comments  路  Source: jazzband/pip-tools

What's the problem this feature will solve?

If CUSTOM_COMPILE_COMMAND is set i expect that this will be executed not only mentioned in comments

Describe the solution you'd like

Script defined in CUSTOM_COMPILE_COMMAND runs on $ pip-compile

Current implementation of CUSTOM_COMPILE_COMMAND is really confusing

Alternative Solutions

Are not found

Additional context

None

awaiting response feature request

Most helpful comment

@atugushev I hope it's not going to be deprecated.

We use it to point to a custom wrapper tool (which handles dependencies between requirement files).

All 11 comments

Hello @belegnar,

Thanks for the issue! I would rather deprecate this environment variable since this the current command generator is doing pretty good its job (refactored in #800).

AFAIR CUSTOM_COMPILE_COMMAND variable was introduced in #500 to override a command header because there were cases where the generator would produce incorrect command.

/cc @ulope

Sorry, but I can't realize how to substitute environment variables into the --index-url
Use case: I use private pip storage and should pass user/pass from env in the url

This env PIP_INDEX_URL might help.

It's published with creds into requirements.txt been produced, but i see an issue about this. Thanks
https://github.com/jazzband/pip-tools/issues/1137

Yeah, we'll work on it after #1130 is being merged.

@atugushev I hope it's not going to be deprecated.

We use it to point to a custom wrapper tool (which handles dependencies between requirement files).

@ulope thanks for the feedback!

@ulope

It's interesting to know about your experience how do you use CUSTOM_COMPILE_COMMAND. Could you elaborate? TBH, I would use --no-header.

CUSTOM_COMPILE_COMMAND is a convenient way to embed documentation when using custom wrapper scripts within a dev team. Then again, thanks to the simple syntax of these files, it's pretty trivial for these wrappers to use --no-header and add a doc comment on their own, "in post."

@atugushev This is the wrapper script which is invoked by this shell script (there's also a readme in the same directory).

I didn't know about the --no-header option until now, that could also work.
But that would mean more code in the wrapper to modify the files after compile and idempotently add the header.
I definitely won't be sad if I don't have to write that code ;)

@ulope

Thanks! Yeah, that's a pretty legit use-case 馃憤


@belegnar

Script defined in CUSTOM_COMPILE_COMMAND runs on $ pip-compile

AFAIK CUSTOM_COMPILE_COMMAND environment is designed for a descriptive command. Users may put there anything they like to, see this case described by @ulope. Considering this I'm -1 on this solution, sorry.

Current implementation of CUSTOM_COMPILE_COMMAND is really confusing

It might worth describing more clearly the usage of the environment variable in README. What do you think?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpkilby picture rpkilby  路  5Comments

sirex picture sirex  路  4Comments

dazza-codes picture dazza-codes  路  3Comments

sp-bot-tools picture sp-bot-tools  路  4Comments

vphilippon picture vphilippon  路  4Comments