File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -904,6 +904,7 @@ The following parameters are available in the `python::pyvenv` defined type:
904
904
* [ ` path ` ] ( #-python--pyvenv--path )
905
905
* [ ` environment ` ] ( #-python--pyvenv--environment )
906
906
* [ ` prompt ` ] ( #-python--pyvenv--prompt )
907
+ * [ ` index ` ] ( #-python--pyvenv--index )
907
908
* [ ` pip_version ` ] ( #-python--pyvenv--pip_version )
908
909
909
910
##### <a name =" -python--pyvenv--ensure " ></a >` ensure `
@@ -986,6 +987,14 @@ Optionally specify the virtualenv prompt (python >= 3.6)
986
987
987
988
Default value: ` undef `
988
989
990
+ ##### <a name =" -python--pyvenv--index " ></a >` index `
991
+
992
+ Data type: ` Optional[String[1]] `
993
+
994
+ Optionally specify an index location from where pip and setuptools should be installed
995
+
996
+ Default value: ` undef `
997
+
989
998
##### <a name =" -python--pyvenv--pip_version " ></a >` pip_version `
990
999
991
1000
Data type: ` Python::Venv::PipVersion `
Original file line number Diff line number Diff line change 11
11
# @param path Specifies the PATH variable.
12
12
# @param environment Optionally specify environment variables for pyvenv
13
13
# @param prompt Optionally specify the virtualenv prompt (python >= 3.6)
14
+ # @param index Optionally specify an index location from where pip and setuptools should be installed
14
15
#
15
16
# @example
16
17
# python::pyvenv { '/var/www/project1' :
34
35
Array $environment = [],
35
36
Optional[String[1]] $prompt = undef ,
36
37
Python::Venv::PipVersion $pip_version = ' latest' ,
38
+ Optional[String[1]] $index = undef ,
37
39
) {
38
40
include python
39
41
80
82
81
83
$pip_cmd = " ${python::exec_prefix}${venv_dir} /bin/pip"
82
84
85
+ $index_config = $index ? {
86
+ undef => ' ' ,
87
+ default => " -i ${index} "
88
+ }
89
+
83
90
$pip_upgrade = ($pip_version != ' latest' ) ? {
84
91
true => " --upgrade 'pip ${pip_version} '" ,
85
92
false => ' --upgrade pip' ,
86
93
}
87
94
88
95
exec { "python_virtualenv_${venv_dir}" :
89
- command => " ${virtualenv_cmd} --clear ${system_pkgs_flag} ${prompt_arg} ${venv_dir} && ${pip_cmd} --log ${venv_dir} /pip.log install ${pip_upgrade} && ${pip_cmd} --log ${venv_dir} /pip.log install --upgrade setuptools" ,
96
+ command => " ${virtualenv_cmd} --clear ${system_pkgs_flag} ${prompt_arg} ${venv_dir} && ${pip_cmd} --log ${venv_dir} /pip.log install ${index_config} ${ pip_upgrade} && ${pip_cmd} --log ${venv_dir} /pip.log install ${index_config} --upgrade setuptools" ,
90
97
user => $owner ,
91
98
creates => " ${venv_dir} /bin/activate" ,
92
99
path => $_path,
You can’t perform that action at this time.
0 commit comments