Specify the PIP_REQUIREMENTS_FILE to use the fully frozen version, generated...
Specify the PIP_REQUIREMENTS_FILE to use the fully frozen version, generated by the compile-and-unit-test stage.
This fully frozen version is reported via an artifact, named all-requirements.txt
Gemnasium Workaround
Note that there is a reported bug in GitLab, requiring a workaround before_script
Extra Index URLs
In doing this, I noticed that some requirements files need extra index URLs in order to work. So, there's now two ways to specify extra index urls.
- The existing way, by adding them to the requirements file in the form:
--extra-index-url URL
. These are nowgrep
ed out, uniqified, and prepended to theall-requirements.txt
file for use there. - By setting a variable,
PIP_EXTRA_INDEX_URLS
, with a space-delimited list of extra index urls. These URLS are added both to theall-requirements.txt
file and to everypip install
operation.
Complete Override of Frozen Requirements
By setting the REQ_COLLECT
variable to a script or series of bash commands, projects can completely override the method to create a list of all dependencies.
This can be used if the default operations -- the concatenation of the PIP_EXTRA_INDEX_URLS
environment variable and any --extra-index-url
lines in the PIP_REQUIREMENTS
-- doesn't provide a correct set of all dependencies.
Testing
Multi Pipeline Test, though this doesn't exercise all possible paths to utilizing this.