How can you pip-compile multiple requirements.txt in one command line. I was hoping that something like this was possible:
$ pip-compile requirements.in dev-requirements.in
OR
$ pip-compile requirements/*.in
and then it would compile and generate the necessary txt file
It works how you hope if you specify the name of the output file; e.g.:
$ echo numpy > requirements_A.in
$ echo requests > requirements_B.in
$ pip-compile --output-file requirements.txt requirements_A.in requirements_B.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements.txt requirements_A.in requirements_B.in
#
certifi==2019.6.16 # via requests
chardet==3.0.4 # via requests
idna==2.8 # via requests
numpy==1.16.4
requests==2.22.0
urllib3==1.25.3 # via requests
Looks like @OdinTech3 wants to get requirements_A.txt and requirements_B.txt from pip-compile requirements_A.in requirements_B.in.
Currently it's impossible to do that, since pip-tools supports only one output file, so you have to compile each *.in file by separate commands.
I see. so @atugushev Is there any interest in supporting supporting this feature? or are there limitations in supporting it.
One option to do this in one command is to use bash xargs, e.g.
$ !echo requirements*.in | xargs -n1 pip-compile
I suspect the limitation in supporting this feature is figuring out how to do it while maintaining backward compatibility with the current API, where passing multiple input files to the compile command leads to all of them being included in a single compilation.
What's the reason for needing this? pip-compile produces one output file. If you want two then you run it twice. Use xargs if you must have it in "one line".
@OdinTech3
I see. so @atugushev Is there any interest in supporting supporting this feature? or are there limitations in supporting it.
I would call it deliberate design decision.
Alright thank you all for your answers and support.
Most helpful comment
@OdinTech3
I would call it deliberate design decision.