File tree Expand file tree Collapse file tree 4 files changed +75
-15
lines changed Expand file tree Collapse file tree 4 files changed +75
-15
lines changed Original file line number Diff line number Diff line change 99#### Public Classes
1010
1111* [ ` python ` ] ( #python ) : Installs and manages python, python-dev and gunicorn.
12+ * [ ` python::install::dev ` ] ( #python--install--dev ) : Installs python development packages
1213* [ ` python::pip::bootstrap ` ] ( #python--pip--bootstrap ) : allow to bootstrap pip when python is managed from other module
1314
1415#### Private Classes
@@ -289,6 +290,10 @@ Data type: `Stdlib::Absolutepath`
289290
290291Default value: ` '/opt/python' `
291292
293+ ### <a name =" python--install--dev " ></a >` python::install::dev `
294+
295+ Installs python development packages
296+
292297### <a name =" python--pip--bootstrap " ></a >` python::pip::bootstrap `
293298
294299allow to bootstrap pip when python is managed from other module
Original file line number Diff line number Diff line change 5454 }
5555
5656 if $python::manage_dev_package and $pythondev {
57- package { 'python-dev' :
58- ensure => $python::dev ,
59- name => $pythondev ,
60- }
57+ contain python::install::dev
6158 }
6259
6360 # Respect the $python::pip setting
180177 }
181178
182179 if $python::manage_dev_package and $pythondev {
183- package { 'python-dev' :
184- ensure => $python::dev ,
185- name => $pythondev ,
186- alias => $pythondev ,
187- provider => ' yum' ,
188- }
180+ contain python::install::dev
189181 }
190182 }
191183 default: {
197189 }
198190
199191 if $python::manage_dev_package and $pythondev {
200- package { 'python-dev' :
201- ensure => $python::dev ,
202- name => $pythondev ,
203- alias => $pythondev ,
204- }
192+ contain python::install::dev
205193 }
206194 }
207195 }
Original file line number Diff line number Diff line change 1+ # @summary Installs python development packages
2+ class python::install::dev {
3+ include python
4+
5+ case $python::provider {
6+ ' pip' : {
7+ package { 'python-dev' :
8+ ensure => $python::dev ,
9+ name => $python::install::pythondev ,
10+ }
11+ }
12+ ' scl' : {
13+ }
14+ ' rhscl' : {
15+ }
16+ ' anaconda' : {
17+ }
18+ default: {
19+ case $facts [' os' ][' family' ] {
20+ ' AIX' : {
21+ package { 'python-dev' :
22+ ensure => $python::dev ,
23+ name => $python::install::pythondev ,
24+ alias => $python::install::pythondev ,
25+ provider => ' yum' ,
26+ }
27+ }
28+ default: {
29+ package { 'python-dev' :
30+ ensure => $python::dev ,
31+ name => $python::install::pythondev ,
32+ alias => $python::install::pythondev ,
33+ }
34+ }
35+ }
36+ }
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'spec_helper'
4+
5+ describe 'python::install::dev' do
6+ on_supported_os . each do |os , facts |
7+ context "on #{ os } " do
8+ let :facts do
9+ facts
10+ end
11+
12+ context 'with default settings' do
13+ it { is_expected . to contain_package ( 'python-dev' ) . with ( ensure : 'absent' ) }
14+ end
15+
16+ context 'when ensuring dev is setup' do
17+ let ( :pre_condition ) do
18+ <<~PP
19+ class { 'python':
20+ dev => present,
21+ }
22+ PP
23+ end
24+
25+ it { is_expected . to contain_package ( 'python-dev' ) . with ( ensure : 'present' ) }
26+ end
27+ end
28+ end
29+ end
You can’t perform that action at this time.
0 commit comments