-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install dev packages in python::install::dev
- Loading branch information
Showing
4 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# @summary Installs python development packages | ||
class python::install::dev { | ||
include python | ||
|
||
case $python::provider { | ||
'pip': { | ||
package { 'python-dev': | ||
ensure => $python::dev, | ||
name => $python::install::pythondev, | ||
} | ||
} | ||
'scl': { | ||
} | ||
'rhscl': { | ||
} | ||
'anaconda': { | ||
} | ||
default: { | ||
case $facts['os']['family'] { | ||
'AIX': { | ||
package { 'python-dev': | ||
ensure => $python::dev, | ||
name => $python::install::pythondev, | ||
alias => $python::install::pythondev, | ||
provider => 'yum', | ||
} | ||
} | ||
default: { | ||
package { 'python-dev': | ||
ensure => $python::dev, | ||
name => $python::install::pythondev, | ||
alias => $python::install::pythondev, | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'python::install::dev' do | ||
on_supported_os.each do |os, facts| | ||
context "on #{os}" do | ||
let :facts do | ||
facts | ||
end | ||
|
||
context 'with default settings' do | ||
it { is_expected.to contain_package('python-dev').with(ensure: 'absent') } | ||
end | ||
|
||
context 'when ensuring dev is setup' do | ||
let(:pre_condition) do | ||
<<~PP | ||
class { 'python': | ||
dev => present, | ||
} | ||
PP | ||
end | ||
|
||
it { is_expected.to contain_package('python-dev').with(ensure: 'present') } | ||
end | ||
end | ||
end | ||
end |