Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.

Commit e797fcf

Browse files
committed
Allow python::version to contain a point (e.g. python3.7)
This worked before voxpupuli#489. Fixes voxpupuli#508.
1 parent a6d6ecb commit e797fcf

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

manifests/install.pp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
class python::install {
88

99
$python = $python::version ? {
10-
'system' => 'python',
11-
'pypy' => 'pypy',
12-
/\A(python)?([0-9]+)/ => "python${2}",
13-
/\Arh-python[0-9]{2}/ => $python::version,
14-
default => "python${python::version}",
10+
'system' => 'python',
11+
'pypy' => 'pypy',
12+
/\A(python[23]\.[0-9]+)/ => $1,
13+
/\A(python)?([0-9]+)/ => "python${2}",
14+
/\Arh-python[0-9]{2}/ => $python::version,
15+
default => "python${python::version}",
1516
}
1617

1718
$pythondev = $facts['os']['family'] ? {

spec/classes/python_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
# Basic python packages (from pip)
2222
it { is_expected.to contain_package('virtualenv') }
2323

24+
describe 'with python::version' do
25+
context 'python3.7' do
26+
let(:params) { { version: 'python3.7' } }
27+
28+
it { is_expected.to compile.with_all_deps }
29+
it { is_expected.to contain_package('pip').with_name('python3.7-pip') }
30+
it { is_expected.to contain_package('python').with_name('python3.7') }
31+
it { is_expected.to contain_package('python-dev').with_name('python3.7-dev') }
32+
it { is_expected.to contain_package('virtualenv').with_name('virtualenv') }
33+
end
34+
end
35+
2436
describe 'with python::dev' do
2537
context 'true' do
2638
let(:params) { { dev: 'present' } }

0 commit comments

Comments
 (0)