-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install venv packages in python::install::venv
- Loading branch information
Showing
7 changed files
with
63 additions
and
18 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,13 @@ | ||
# @summary Installs python virtualenv packages | ||
class python::install::venv { | ||
include python | ||
|
||
# Main python package bundle venv on some operating systems | ||
unless $facts['os']['family'] in ['Archlinux', 'FreeBSD', 'RedHat'] { | ||
package { 'python-venv': | ||
ensure => $python::venv, | ||
name => "${python::install::python}-venv", | ||
require => Package['python'], | ||
} | ||
} | ||
} |
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,37 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'python::install::venv' do | ||
on_supported_os.each do |os, facts| | ||
context "on #{os}" do | ||
let :facts do | ||
facts | ||
end | ||
|
||
context 'with default settings' do | ||
if %w[Archlinux FreeBSD RedHat].include?(facts[:os]['family']) | ||
it { is_expected.not_to contain_package('python-venv') } | ||
else | ||
it { is_expected.to contain_package('python-venv').with(ensure: 'absent') } | ||
end | ||
end | ||
|
||
context 'when ensuring venv is setup' do | ||
let(:pre_condition) do | ||
<<~PP | ||
class { 'python': | ||
venv => present, | ||
} | ||
PP | ||
end | ||
|
||
if %w[Archlinux FreeBSD RedHat].include?(facts[:os]['family']) | ||
it { is_expected.not_to contain_package('python-venv') } | ||
else | ||
it { is_expected.to contain_package('python-venv').with(ensure: 'present') } | ||
end | ||
end | ||
end | ||
end | ||
end |
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