Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "VoxBox",
"image": "ghcr.io/voxpupuli/voxbox:latest"
Expand Down
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: '10.5.0'
modulesync_config_version: '10.6.0'
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
inherit_from: .rubocop_todo.yml

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

Expand Down
13 changes: 13 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
# using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
RSpec/LeakyLocalVariable:
Exclude:
- 'spec/acceptance/class_spec.rb'
- 'spec/acceptance/facts_test_spec.rb'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 13.0', :require => false
gem 'voxpupuli-test', '~> 14.0', :require => false
gem 'puppet_metadata', '~> 6.0', :require => false
end

Expand All @@ -18,7 +18,7 @@ group :system_tests do
end

group :release do
gem 'voxpupuli-release', '~> 5.0', :require => false
gem 'voxpupuli-release', '~> 5.3', :require => false
end

gem 'rake', :require => false
Expand Down
2 changes: 2 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Data type: `Python::Version`

The default version of Python provided by the operating system. Only used as a fallback if Python is not installed yet to determine how to handle some actions that vary depending on the Python version used.

Default value: `'3.11'`

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

Data type: `Python::Package::Ensure`
Expand Down
46 changes: 23 additions & 23 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
manage_python_package: false,
manage_dev_package: false,
manage_pip_package: false,
manage_venv_package: false
manage_venv_package: false,
}
end

Expand All @@ -53,7 +53,7 @@
manage_pip_package: true,
manage_venv_package: true,
pip: 'present',
venv: 'present'
venv: 'present',
}
end

Expand Down Expand Up @@ -112,12 +112,12 @@
{
python_pyvenvs: {
'/opt/env1' => {
version: '3.8'
version: '3.8',
},
'/opt/env2' => {
version: '3.8'
}
}
version: '3.8',
},
},
}
end

Expand All @@ -139,13 +139,13 @@
python_pyvenvs: {
'/opt/env1' => {
version: '3.8',
pip_version: 'latest'
pip_version: 'latest',
},
'/opt/env2' => {
version: '3.8',
pip_version: '<= 20.3.4'
}
}
pip_version: '<= 20.3.4',
},
},
}
end

Expand All @@ -155,43 +155,43 @@
it { is_expected.to contain_python__pyvenv('/opt/env2').with_ensure('present') }

it {
expect(subject).to contain_exec('python_virtualenv_/opt/env1').
with(
expect(subject).to contain_exec('python_virtualenv_/opt/env1')
.with(
command: 'python3.8 -m venv --clear /opt/env1 && /opt/env1/bin/pip install --upgrade pip && /opt/env1/bin/pip install --upgrade setuptools',
user: 'root',
creates: '/opt/env1/bin/activate',
path: [
'/bin',
'/usr/bin',
'/usr/sbin',
'/usr/local/bin'
'/usr/local/bin',
],
cwd: '/tmp',
environment: [],
timeout: 600,
unless: %r{^grep '\^\[\\t \]\*VIRTUAL_ENV=\[\\\\'\\"\]\*/opt/env1\[\\"\\\\'\]\[\\t \]\*\$' /opt/env1/bin/activate$}
).
that_requires('File[/opt/env1]')
unless: %r{^grep '\^\[\\t \]\*VIRTUAL_ENV=\[\\\\'\\"\]\*/opt/env1\[\\"\\\\'\]\[\\t \]\*\$' /opt/env1/bin/activate$},
)
.that_requires('File[/opt/env1]')
}

it {
expect(subject).to contain_exec('python_virtualenv_/opt/env2').
with(
expect(subject).to contain_exec('python_virtualenv_/opt/env2')
.with(
command: 'python3.8 -m venv --clear /opt/env2 && /opt/env2/bin/pip install --upgrade \'pip <= 20.3.4\' && /opt/env2/bin/pip install --upgrade setuptools',
user: 'root',
creates: '/opt/env2/bin/activate',
path: [
'/bin',
'/usr/bin',
'/usr/sbin',
'/usr/local/bin'
'/usr/local/bin',
],
cwd: '/tmp',
environment: [],
timeout: 600,
unless: %r{^grep '\^\[\\t \]\*VIRTUAL_ENV=\[\\\\'\\"\]\*/opt/env2\[\\"\\\\'\]\[\\t \]\*\$' /opt/env2/bin/activate$}
).
that_requires('File[/opt/env2]')
unless: %r{^grep '\^\[\\t \]\*VIRTUAL_ENV=\[\\\\'\\"\]\*/opt/env2\[\\"\\\\'\]\[\\t \]\*\$' /opt/env2/bin/activate$},
)
.that_requires('File[/opt/env2]')
}

it { is_expected.to contain_file('/opt/env1') }
Expand Down Expand Up @@ -384,7 +384,7 @@

it {
expect(subject).to contain_package('pip').with(
'provider' => 'pip'
'provider' => 'pip',
)
}
end
Expand Down
8 changes: 4 additions & 4 deletions spec/defines/pip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
operatingsystemrelease: '6',
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
concat_basedir: '/dne',
pip_version: '18.1'
pip_version: '18.1',
}
end

Expand Down Expand Up @@ -195,7 +195,7 @@
operatingsystemrelease: '10.12',
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
concat_basedir: '/dne',
pip_version: '20.3.4'
pip_version: '20.3.4',
}
end

Expand All @@ -221,13 +221,13 @@
kernel: 'Linux',
lsbdistcodename: 'squeeze',
os: {
family: 'Debian'
family: 'Debian',
},
osfamily: 'Debian',
operatingsystem: 'Debian',
operatingsystemrelease: '6',
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
concat_basedir: '/dne'
concat_basedir: '/dne',
}
end

Expand Down
8 changes: 4 additions & 4 deletions spec/defines/pyvenv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
let :facts do
# python3 is required to use pyvenv
facts.merge(
python3_version: '3.5.1'
python3_version: '3.5.1',
)
end

Expand All @@ -36,7 +36,7 @@
context 'is absent' do
let :params do
{
ensure: 'absent'
ensure: 'absent',
}
end

Expand All @@ -51,7 +51,7 @@
let :facts do
# python 3.6 is required for venv and prompt
facts.merge(
python3_version: '3.6.1'
python3_version: '3.6.1',
)
end
let :title do
Expand All @@ -75,7 +75,7 @@
context "prompt on #{os} with python 3.5" do
let :facts do
facts.merge(
python3_version: '3.5.1'
python3_version: '3.5.1',
)
end
let :title do
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/requirements_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
context 'with /requirements.txt' do
let :params do
{
requirements: '/requirements.txt'
requirements: '/requirements.txt',
}
end

Expand All @@ -35,7 +35,7 @@
let :params do
{
owner: 'bob',
group: 'bob'
group: 'bob',
}
end

Expand Down
2 changes: 0 additions & 2 deletions spec/unit/facter/pip_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Facter.clear
end

# rubocop:disable RSpec/IndexedLet
let(:pip_version_output) do
<<~EOS
pip 6.0.6 from /opt/boxen/homebrew/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg (python 2.7)
Expand All @@ -25,7 +24,6 @@
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
EOS
end
# rubocop:enable RSpec/IndexedLet

describe 'pip_version' do
context 'returns pip version when pip present' do
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/facter/python_release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Facter.clear
end

# rubocop:disable RSpec/IndexedLet
let(:python2_version_output) do
<<~EOS
Python 2.7.9
Expand All @@ -18,7 +17,6 @@
Python 3.3.0
EOS
end
# rubocop:enable RSpec/IndexedLet

describe 'python_release' do
context 'returns Python release when `python` present' do
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/facter/python_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Facter.clear
end

# rubocop:disable RSpec/IndexedLet
let(:python2_version_output) do
<<~EOS
Python 2.7.9
Expand All @@ -18,7 +17,6 @@
Python 3.3.0
EOS
end
# rubocop:enable RSpec/IndexedLet

describe 'python_version' do
context 'returns Python version when `python` present' do
Expand Down
Loading