Skip to content

Commit

Permalink
Merge pull request #669 from voxpupuli/rework-package-management
Browse files Browse the repository at this point in the history
Allow to skip management of python dev package
  • Loading branch information
bastelfreak authored Nov 27, 2023
2 parents 2ac598c + 5bd8f1b commit 4a4c467
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ The following parameters are available in the `python` class:
* [`umask`](#-python--umask)
* [`manage_gunicorn`](#-python--manage_gunicorn)
* [`manage_python_package`](#-python--manage_python_package)
* [`manage_dev_package`](#-python--manage_dev_package)
* [`manage_venv_package`](#-python--manage_venv_package)
* [`manage_pip_package`](#-python--manage_pip_package)
* [`venv`](#-python--venv)
Expand Down Expand Up @@ -192,6 +193,14 @@ manage the state for package python

Default value: `true`

##### <a name="-python--manage_dev_package"></a>`manage_dev_package`

Data type: `Boolean`

manage the state of the python development package

Default value: `true`

##### <a name="-python--manage_venv_package"></a>`manage_venv_package`

Data type: `Boolean`
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# @param umask The default umask for invoked exec calls.
# @param manage_gunicorn manage the state for package gunicorn
# @param manage_python_package manage the state for package python
# @param manage_dev_package manage the state of the python development package
# @param manage_venv_package manage the state for package venv
# @param manage_pip_package manage the state for package pip
#
Expand All @@ -45,6 +46,7 @@
Python::Package::Ensure $gunicorn = 'absent',
Boolean $manage_gunicorn = true,
Boolean $manage_python_package = true,
Boolean $manage_dev_package = true,
Boolean $manage_venv_package = $python::params::manage_venv_package,
Boolean $manage_pip_package = $python::params::manage_pip_package,
String[1] $gunicorn_package_name = $python::params::gunicorn_package_name,
Expand Down
6 changes: 3 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
}

if $pythondev {
if $python::manage_dev_package and $pythondev {
package { 'python-dev':
ensure => $python::dev,
name => $pythondev,
Expand Down Expand Up @@ -179,7 +179,7 @@
}
}

if $pythondev {
if $python::manage_dev_package and $pythondev {
package { 'python-dev':
ensure => $python::dev,
name => $pythondev,
Expand All @@ -196,7 +196,7 @@
}
}

if $pythondev {
if $python::manage_dev_package and $pythondev {
package { 'python-dev':
ensure => $python::dev,
name => $pythondev,
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
let :params do
{
manage_python_package: false,
manage_dev_package: false,
manage_pip_package: false,
manage_venv_package: false
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_package('python') }
it { is_expected.not_to contain_package('python-dev') }
it { is_expected.not_to contain_package('pip') }
it { is_expected.not_to contain_package('python-venv') }
end
Expand Down

0 comments on commit 4a4c467

Please sign in to comment.