7 changes: 3 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as:

```sh
export PUPPET_VERSION="~> 5.5.6"
export PUPPET_GEM_VERSION="~> 6.1.0"
```

You can install all needed gems for spec tests into the modules directory by
Expand Down Expand Up @@ -232,17 +232,16 @@ simple tests against it after applying the module. You can run this
with:

```sh
BEAKER_setfile=debian10-x64 bundle exec rake beaker
BEAKER_setfile=debian11-64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
The following strings are known to work:

* ubuntu1604
* ubuntu1804
* ubuntu2004
* debian9
* debian10
* debian11
* centos7
* centos8

Expand Down
84 changes: 6 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,12 @@ name: CI
on: pull_request

concurrency:
group: ${{ github.head_ref }}
group: ${{ github.ref_name }}
cancel-in-progress: true

jobs:
setup_matrix:
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
timeout-minutes: 40
outputs:
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Run static validations
run: bundle exec rake validate lint check
- name: Run rake rubocop
run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false

unit:
needs: setup_matrix
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake parallel_spec

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}

tests:
needs:
- unit
- acceptance
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'false'
32 changes: 10 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@ on:
tags:
- '*'

env:
BUNDLE_WITHOUT: development:test:system_tests

jobs:
deploy:
name: 'deploy to forge'
runs-on: ubuntu-latest
if: github.repository_owner == 'voxpupuli'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Build and Deploy
env:
# Configure secrets here:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}'
BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}'
run: bundle exec rake module:push
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
with:
allowed_owner: 'voxpupuli'
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
username: ${{ secrets.PUPPET_FORGE_USERNAME }}
api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '5.1.0'
modulesync_config_version: '5.3.0'
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v6.3.0](https://github.com/voxpupuli/puppet-python/tree/v6.3.0) (2022-07-18)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v6.2.1...v6.3.0)

**Implemented enhancements:**

- allow puppet/epel v4 [\#634](https://github.com/voxpupuli/puppet-python/pull/634) ([vchepkov](https://github.com/vchepkov))
- cleanup references to obsolete virtualenv parameter/command [\#633](https://github.com/voxpupuli/puppet-python/pull/633) ([vchepkov](https://github.com/vchepkov))

**Fixed bugs:**

- Add python-venv installation [\#579](https://github.com/voxpupuli/puppet-python/pull/579) ([crazymind1337](https://github.com/crazymind1337))

## [v6.2.1](https://github.com/voxpupuli/puppet-python/tree/v6.2.1) (2021-12-10)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v6.2.0...v6.2.1)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /opt/puppet
# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
RUN mkdir -p /etc/sv

ARG PUPPET_VERSION="~> 6.0"
ARG PUPPET_GEM_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4

# Cache gems
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

source ENV['GEM_SOURCE'] || "https://rubygems.org"
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 5.0', :require => false
gem 'voxpupuli-test', '~> 5.4', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 1.0', :require => false
Expand All @@ -28,7 +28,7 @@ end
gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]

puppetversion = ENV['PUPPET_VERSION'] || '>= 6.0'
puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0'
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
49 changes: 37 additions & 12 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@

### Data types

* [`Python::Loglevel`](#pythonloglevel): A version type to match all valid loglevels for python
* [`Python::Package::Ensure`](#pythonpackageensure): A version type to match all valid package ensures for python
* [`Python::Provider`](#pythonprovider): A version type to match all valid provider for python
* [`Python::Umask`](#pythonumask): A version type to match valid umask for python
* [`Python::Loglevel`](#pythonloglevel): Match all valid loglevels for python
* [`Python::Package::Ensure`](#pythonpackageensure): Match all valid package ensures for python
* [`Python::Provider`](#pythonprovider): Match all valid provider for python
* [`Python::Umask`](#pythonumask): Match valid umask for python
* [`Python::Venv::PipVersion`](#pythonvenvpipversion): A version type to ensure a specific Pip version in a virtual env.
* [`Python::Version`](#pythonversion): A version type to match all valid versions for python
* [`Python::Version`](#pythonversion): Match all valid versions for python

## Classes

Expand Down Expand Up @@ -77,8 +77,11 @@ The following parameters are available in the `python` class:
* [`use_epel`](#use_epel)
* [`manage_scl`](#manage_scl)
* [`umask`](#umask)
* [`manage_gunicorn`](#manage_gunicorn)
* [`manage_python_package`](#manage_python_package)
* [`manage_venv_package`](#manage_venv_package)
* [`manage_pip_package`](#manage_pip_package)
* [`venv`](#venv)
* [`gunicorn_package_name`](#gunicorn_package_name)
* [`python_pips`](#python_pips)
* [`python_pyvenvs`](#python_pyvenvs)
Expand Down Expand Up @@ -175,22 +178,44 @@ The default umask for invoked exec calls.

Default value: ``undef``

##### <a name="manage_gunicorn"></a>`manage_gunicorn`

manage the state for package gunicorn

Default value: `$python::params::manage_gunicorn`

##### <a name="manage_python_package"></a>`manage_python_package`

Data type: `Boolean`


manage the state for package python

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

##### <a name="manage_pip_package"></a>`manage_pip_package`
##### <a name="manage_venv_package"></a>`manage_venv_package`

Data type: `Boolean`

manage the state for package venv

Default value: `$python::params::manage_venv_package`

##### <a name="manage_pip_package"></a>`manage_pip_package`

Data type: `Boolean`

manage the state for package pip

Default value: `$python::params::manage_pip_package`

##### <a name="venv"></a>`venv`

Data type: `Python::Package::Ensure`



Default value: `$python::params::venv`

##### <a name="gunicorn_package_name"></a>`gunicorn_package_name`

Data type: `String[1]`
Expand Down Expand Up @@ -1112,7 +1137,7 @@ Default value: `1800`

### <a name="pythonloglevel"></a>`Python::Loglevel`

A version type to match all valid loglevels for python
Match all valid loglevels for python

Alias of

Expand All @@ -1122,7 +1147,7 @@ Enum['debug', 'info', 'warning', 'error', 'critical']

### <a name="pythonpackageensure"></a>`Python::Package::Ensure`

A version type to match all valid package ensures for python
Match all valid package ensures for python

Alias of

Expand All @@ -1132,7 +1157,7 @@ Enum['absent', 'present', 'latest']

### <a name="pythonprovider"></a>`Python::Provider`

A version type to match all valid provider for python
Match all valid provider for python

Alias of

Expand All @@ -1142,7 +1167,7 @@ Enum['pip', 'scl', 'rhscl', 'anaconda', '']

### <a name="pythonumask"></a>`Python::Umask`

A version type to match valid umask for python
Match valid umask for python

Alias of

Expand All @@ -1162,7 +1187,7 @@ Pattern[/^(<|>|<=|>=|==) [0-9]*(\.[0-9]+)*$/, /\Alatest\Z/]

### <a name="pythonversion"></a>`Python::Version`

A version type to match all valid versions for python
Match all valid versions for python

Alias of

Expand Down
5 changes: 2 additions & 3 deletions examples/gunicorn.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class { 'python':
version => 'system',
dev => true,
virtualenv => true,
version => 'system',
dev => true,
}

python::gunicorn { 'vhost':
Expand Down
5 changes: 2 additions & 3 deletions examples/init.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class { 'python':
version => 'system',
dev => true,
virtualenv => true,
version => 'system',
dev => true,
}
5 changes: 2 additions & 3 deletions examples/pip.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class { 'python':
version => 'system',
dev => true,
virtualenv => true,
version => 'system',
dev => true,
}

python::pip { 'flask':
Expand Down
5 changes: 2 additions & 3 deletions examples/requirements.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class { 'python':
version => 'system',
dev => true,
virtualenv => true,
version => 'system',
dev => true,
}

python::requirements { '/var/www/project1/requirements.txt':
Expand Down
13 changes: 0 additions & 13 deletions examples/virtualenv.pp

This file was deleted.

Loading