|
9 | 9 | # @param owner The owner of the virtualenv being manipulated. |
10 | 10 | # @param group The group of the virtualenv being manipulated. |
11 | 11 | # @param index Base URL of Python package index. |
| 12 | +# @param extra_index Base URL of extra Python package index. |
12 | 13 | # @param proxy Proxy server to use for outbound connections. |
13 | 14 | # @param editable If true the package is installed as an editable resource. |
14 | 15 | # @param environment Additional environment variables required to install the packages. |
|
57 | 58 | Optional[String[1]] $group = getvar('python::params::group'), |
58 | 59 | Optional[Python::Umask] $umask = undef, |
59 | 60 | Variant[Boolean,String[1]] $index = false, |
| 61 | + Variant[Boolean,String[1]] $extra_index = false, |
60 | 62 | Optional[Stdlib::HTTPUrl] $proxy = undef, |
61 | 63 | Any $egg = false, |
62 | 64 | Boolean $editable = false, |
|
114 | 116 | default => "--index-url=${index}", |
115 | 117 | } |
116 | 118 |
|
| 119 | + $pypi_extra_index = $extra_index ? { |
| 120 | + false => '', |
| 121 | + default => "--extra-index-url=${extra_index}", |
| 122 | + } |
| 123 | + |
117 | 124 | $proxy_flag = $proxy ? { |
118 | 125 | undef => '', |
119 | 126 | default => "--proxy=${proxy}", |
|
173 | 180 | } |
174 | 181 |
|
175 | 182 | $pip_install = "${pip_env} --log ${log}/pip.log install" |
176 | | - $pip_common_args = "${pypi_index} ${proxy_flag} ${install_editable} ${source}" |
| 183 | + $pip_common_args = "${pypi_index} ${pypi_extra_index} ${proxy_flag} ${install_editable} ${source}" |
177 | 184 |
|
178 | 185 | # Explicit version out of VCS when PIP supported URL is provided |
179 | 186 | if $source =~ /^'(git\+|hg\+|bzr\+|svn\+)(http|https|ssh|svn|sftp|ftp|lp|git)(:\/\/).+'$/ { |
|
204 | 211 | # Note: we DO need to repeat ourselves with "from version" in both grep and sed as on some systems pip returns |
205 | 212 | # more than one line with paretheses. |
206 | 213 | $latest_version = join( [ |
207 | | - "${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1", |
| 214 | + "${pip_install} ${pypi_index} ${pypi_extra_index} ${proxy_flag}", |
| 215 | + " ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1", |
208 | 216 | ' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"', |
209 | 217 | ' | tr -d "[:space:]"', |
210 | 218 | ]) |
|
0 commit comments