Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow minor version in python::version e.g. python3.7 #524

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
class python::install {

$python = $python::version ? {
'system' => 'python',
'pypy' => 'pypy',
/\A(python)?([0-9]+)/ => "python${2}",
/\Arh-python[0-9]{2}/ => $python::version,
default => "python${python::version}",
'system' => 'python',
'pypy' => 'pypy',
/\A(python)?(\d)\.(\d)/ => "python${2}.${3}",
/\A(python)?(\d+)/ => "python${2}",
/\Arh-python\d{2}/ => $python::version,
default => "python${python::version}",
}

$pythondev = $facts['os']['family'] ? {
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
# Basic python packages (from pip)
it { is_expected.to contain_package('virtualenv') }

describe 'with python::version' do
context 'python3.7' do
let(:params) { { version: 'python3.7' } }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python').with_name('python3.7') }
end
end

describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'present' } }
Expand Down