P Li
P Li

Reputation: 5232

how to not print the index url in generated requirements.txt when using piptools

I am using piptools to compile requirements.in to generate requirements.txt.

I also have some index url written in my .pip/pip.conf file which I store my credentials to our python artifactory repo. So whenever I do pip-compile requirements.in the generated requirements.txt will contain a line reflecting that index url such as the following. I don't want this line to be there, is there a configuration where we can configure pip-tools to not generate this line to requirements.txt?

--extra-index-url https://pli:[email protected]/api/pypi/pypi-virtual/simple

Upvotes: 9

Views: 2910

Answers (1)

P Li
P Li

Reputation: 5232

add the --no-emit-index-url flag to the pip-compile command, or --no-index for pre-5.2.0 versions.

EDIT: Official docs for this flag are here.

Upvotes: 10

Related Questions