Skip to content

Commit 911daa0

Browse files
authored
Merge pull request #595 from bastelfreak/cleanup
Set default python to 3
2 parents d9c51a8 + da2b6b5 commit 911daa0

15 files changed

+23
-840
lines changed

REFERENCE.md

+3-205
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#### Public Classes
1010

11-
* [`python`](#python): Installs and manages python, python-dev, python-virtualenv and gunicorn.
11+
* [`python`](#python): Installs and manages python, python-dev and gunicorn.
1212
* [`python::pip::bootstrap`](#pythonpipbootstrap): allow to bootstrap pip when python is managed from other module
1313

1414
#### Private Classes
@@ -24,7 +24,6 @@
2424
* [`python::pip`](#pythonpip): Installs and manages packages from pip.
2525
* [`python::pyvenv`](#pythonpyvenv): Create a Python3 virtualenv using pyvenv.
2626
* [`python::requirements`](#pythonrequirements): Installs and manages Python packages from requirements file.
27-
* [`python::virtualenv`](#pythonvirtualenv): Creates Python virtualenv.
2827

2928
### Data types
3029

@@ -38,7 +37,7 @@
3837

3938
### `python`
4039

41-
Installs and manages python, python-dev, python-virtualenv and gunicorn.
40+
Installs and manages python, python-dev and gunicorn.
4241

4342
#### Examples
4443

@@ -49,7 +48,6 @@ class { 'python':
4948
version => 'system',
5049
pip => 'present',
5150
dev => 'present',
52-
virtualenv => 'present',
5351
gunicorn => 'present',
5452
}
5553
```
@@ -61,7 +59,6 @@ class { 'python' :
6159
ensure => 'present',
6260
version => 'rh-python36-python',
6361
dev => 'present',
64-
virtualenv => 'present',
6562
}
6663
```
6764

@@ -90,7 +87,7 @@ Allowed values:
9087
- 3/3.3/... means you are going to install the python3/python3.3/...
9188
package, if available on your osfamily.
9289

93-
Default value: `$python::params::version`
90+
Default value: `'3'`
9491

9592
##### `pip`
9693

@@ -108,14 +105,6 @@ Desired installation state for the python-dev package.
108105

109106
Default value: `$python::params::dev`
110107

111-
##### `virtualenv`
112-
113-
Data type: `Python::Package::Ensure`
114-
115-
Desired installation state for the virtualenv package
116-
117-
Default value: `$python::params::virtualenv`
118-
119108
##### `gunicorn`
120109

121110
Data type: `Python::Package::Ensure`
@@ -172,14 +161,6 @@ Data type: `Boolean`
172161

173162
Default value: `$python::params::manage_python_package`
174163

175-
##### `manage_virtualenv_package`
176-
177-
Data type: `Boolean`
178-
179-
180-
181-
Default value: `$python::params::manage_virtualenv_package`
182-
183164
##### `manage_pip_package`
184165

185166
Data type: `Boolean`
@@ -202,14 +183,6 @@ Data type: `Hash`
202183

203184

204185

205-
Default value: `{}`
206-
207-
##### `python_virtualenvs`
208-
209-
Data type: `Hash`
210-
211-
212-
213186
Default value: `{}`
214187

215188
##### `python_pyvenvs`
@@ -1023,181 +996,6 @@ The maximum time in seconds the "pip install" command should take.
1023996

1024997
Default value: `1800`
1025998

1026-
### `python::virtualenv`
1027-
1028-
Creates Python virtualenv.
1029-
1030-
#### Examples
1031-
1032-
##### install a virtual env at /var/www/project1
1033-
1034-
```puppet
1035-
python::virtualenv { '/var/www/project1':
1036-
ensure => present,
1037-
version => 'system',
1038-
requirements => '/var/www/project1/requirements.txt',
1039-
proxy => 'http://proxy.domain.com:3128',
1040-
systempkgs => true,
1041-
index => 'http://www.example.com/simple/',
1042-
}
1043-
```
1044-
1045-
#### Parameters
1046-
1047-
The following parameters are available in the `python::virtualenv` defined type.
1048-
1049-
##### `ensure`
1050-
1051-
Data type: `Python::Package::Ensure`
1052-
1053-
1054-
1055-
Default value: `'present'`
1056-
1057-
##### `version`
1058-
1059-
Data type: `Python::Version`
1060-
1061-
Python version to use.
1062-
1063-
Default value: `'system'`
1064-
1065-
##### `requirements`
1066-
1067-
Data type: `Variant[Boolean,Stdlib::Absolutepath]`
1068-
1069-
Path to pip requirements.txt file
1070-
1071-
Default value: ``false``
1072-
1073-
##### `systempkgs`
1074-
1075-
Data type: `Boolean`
1076-
1077-
Copy system site-packages into virtualenv.
1078-
1079-
Default value: ``false``
1080-
1081-
##### `venv_dir`
1082-
1083-
Data type: `Stdlib::Absolutepath`
1084-
1085-
Directory to install virtualenv to
1086-
1087-
Default value: `$name`
1088-
1089-
##### `ensure_venv_dir`
1090-
1091-
Data type: `Boolean`
1092-
1093-
Create $venv_dir
1094-
1095-
Default value: ``true``
1096-
1097-
##### `distribute`
1098-
1099-
Data type: `Boolean`
1100-
1101-
Include distribute in the virtualenv
1102-
1103-
Default value: ``true``
1104-
1105-
##### `index`
1106-
1107-
Data type: `Variant[Boolean,Stdlib::HTTPUrl]`
1108-
1109-
Base URL of Python package index
1110-
1111-
Default value: ``false``
1112-
1113-
##### `owner`
1114-
1115-
Data type: `String[1]`
1116-
1117-
The owner of the virtualenv being manipulated
1118-
1119-
Default value: `'root'`
1120-
1121-
##### `group`
1122-
1123-
Data type: `String[1]`
1124-
1125-
The group relating to the virtualenv being manipulated
1126-
1127-
Default value: `'root'`
1128-
1129-
##### `mode`
1130-
1131-
Data type: `Stdlib::Filemode`
1132-
1133-
Optionally specify directory mode
1134-
1135-
Default value: `'0755'`
1136-
1137-
##### `proxy`
1138-
1139-
Data type: `Optional[Stdlib::HTTPUrl]`
1140-
1141-
Proxy server to use for outbound connections
1142-
1143-
Default value: ``undef``
1144-
1145-
##### `environment`
1146-
1147-
Data type: `Array`
1148-
1149-
Additional environment variables required to install the packages
1150-
1151-
Default value: `[]`
1152-
1153-
##### `path`
1154-
1155-
Data type: `Array[Stdlib::Absolutepath]`
1156-
1157-
Specifies the PATH variable
1158-
1159-
Default value: `['/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin',]`
1160-
1161-
##### `cwd`
1162-
1163-
Data type: `Optional[Stdlib::Absolutepath]`
1164-
1165-
The directory from which to run the "pip install" command
1166-
1167-
Default value: ``undef``
1168-
1169-
##### `timeout`
1170-
1171-
Data type: `Integer`
1172-
1173-
The maximum time in seconds the "pip install" command should take
1174-
1175-
Default value: `1800`
1176-
1177-
##### `pip_args`
1178-
1179-
Data type: `String`
1180-
1181-
Arguments to pass to pip during initialization
1182-
1183-
Default value: `''`
1184-
1185-
##### `extra_pip_args`
1186-
1187-
Data type: `String`
1188-
1189-
Extra arguments to pass to pip after requirements file
1190-
1191-
Default value: `''`
1192-
1193-
##### `virtualenv`
1194-
1195-
Data type: `Optional[Stdlib::Absolutepath]`
1196-
1197-
1198-
1199-
Default value: ``undef``
1200-
1201999
## Data types
12021000

12031001
### `Python::Loglevel`

manifests/config.pp

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
class python::config {
88
Class['python::install'] -> Python::Pip <| |>
99
Class['python::install'] -> Python::Requirements <| |>
10-
Class['python::install'] -> Python::Virtualenv <| |>
11-
12-
Python::Virtualenv <| |> -> Python::Pip <| |>
1310

1411
if $python::manage_gunicorn {
1512
unless $python::gunicorn == 'absent' {

manifests/init.pp

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @summary Installs and manages python, python-dev, python-virtualenv and gunicorn.
1+
# @summary Installs and manages python, python-dev and gunicorn.
22
#
33
# @param ensure Desired installation state for the Python package.
44
# @param version Python version to install. Beware that valid values for this differ a) by the provider you choose and b) by the osfamily/operatingsystem you are using.
@@ -11,7 +11,6 @@
1111
# package, if available on your osfamily.
1212
# @param pip Desired installation state for the python-pip package.
1313
# @param dev Desired installation state for the python-dev package.
14-
# @param virtualenv Desired installation state for the virtualenv package
1514
# @param gunicorn Desired installation state for Gunicorn.
1615
# @param manage_gunicorn Allow Installation / Removal of Gunicorn.
1716
# @param provider What provider to use for installation of the packages, except gunicorn and Python itself.
@@ -24,32 +23,27 @@
2423
# version => 'system',
2524
# pip => 'present',
2625
# dev => 'present',
27-
# virtualenv => 'present',
2826
# gunicorn => 'present',
2927
# }
3028
# @example install python3 from scl repo
3129
# class { 'python' :
3230
# ensure => 'present',
3331
# version => 'rh-python36-python',
3432
# dev => 'present',
35-
# virtualenv => 'present',
3633
# }
3734
#
3835
class python (
3936
Python::Package::Ensure $ensure = $python::params::ensure,
40-
Python::Version $version = $python::params::version,
37+
Python::Version $version = '3',
4138
Python::Package::Ensure $pip = $python::params::pip,
4239
Python::Package::Ensure $dev = $python::params::dev,
43-
Python::Package::Ensure $virtualenv = $python::params::virtualenv,
4440
Python::Package::Ensure $gunicorn = $python::params::gunicorn,
4541
Boolean $manage_gunicorn = $python::params::manage_gunicorn,
4642
Boolean $manage_python_package = $python::params::manage_python_package,
47-
Boolean $manage_virtualenv_package = $python::params::manage_virtualenv_package,
4843
Boolean $manage_pip_package = $python::params::manage_pip_package,
4944
String[1] $gunicorn_package_name = $python::params::gunicorn_package_name,
5045
Optional[Python::Provider] $provider = $python::params::provider,
5146
Hash $python_pips = {},
52-
Hash $python_virtualenvs = {},
5347
Hash $python_pyvenvs = {},
5448
Hash $python_requirements = {},
5549
Hash $python_dotfiles = {},
@@ -80,7 +74,6 @@
8074
# Allow hiera configuration of python resources
8175
create_resources('python::pip', $python_pips)
8276
create_resources('python::pyvenv', $python_pyvenvs)
83-
create_resources('python::virtualenv', $python_virtualenvs)
8477
create_resources('python::requirements', $python_requirements)
8578
create_resources('python::dotfile', $python_dotfiles)
8679
}

0 commit comments

Comments
 (0)