|
37 | 37 |
|
38 | 38 | if $ensure == 'present' {
|
39 | 39 |
|
40 |
| - $virtualenv_cmd = $version ? { |
41 |
| - 'system' => "${python::exec_prefix}pyvenv", |
42 |
| - default => "${python::exec_prefix}pyvenv-${version}", |
| 40 | + # Debian splits the venv module into a seperate package |
| 41 | + if ( $facts['os']['family'] == 'Debian'){ |
| 42 | + $python3_venv_package="python${version}-venv" |
| 43 | + case $facts['os']['distro']['codename'] { |
| 44 | + 'xenial','bionic','cosmic','disco', |
| 45 | + 'jessie','stretch','buster': { |
| 46 | + package {$python3_venv_package: |
| 47 | + before => File[$venv_dir], |
| 48 | + } |
| 49 | + } |
| 50 | + default: {} |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + # pyvenv is deprecated since 3.6 and will be removed in 3.8 |
| 55 | + if (versioncmp($::python3_version, '3.6') >=0) { |
| 56 | + $virtualenv_cmd = $version ? { |
| 57 | + 'system' => "${python::exec_prefix}python3 -m venv", |
| 58 | + default => "${python::exec_prefix}python${version} -m venv", |
| 59 | + } |
| 60 | + } else { |
| 61 | + $virtualenv_cmd = $version ? { |
| 62 | + 'system' => "${python::exec_prefix}pyvenv", |
| 63 | + default => "${python::exec_prefix}pyvenv-${version}", |
| 64 | + } |
43 | 65 | }
|
44 | 66 |
|
45 | 67 | $_path = $::python::provider ? {
|
|
0 commit comments