GitHub puppet-python
Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.

Repo Checks ( 15 of 19 successfull )
Metadata Valid
No translation
passed
Correct Puppet Version Range
Supported Puppet version range is %{PUPPET_SUPPORT_RANGE}
passed
With Puppet Version Range
Puppet version range is present in requirements in metadata.json
passed
With Operatingsystem Support
No translation
passed
Supports Only Current Centos
No translation
failed
Supports Latest Centos
No translation
passed
Supports Only Current Debian
No translation
failed
Supports Latest Debian
No translation
passed
Supports Only Current Freebsd
No translation
failed
Supports Latest Freebsd
No translation
passed
Supports Only Current Ubuntu
No translation
failed
Supports Latest Ubuntu
No translation
passed
In Modulesync Repo
Is listed as a module managed using modulesync_config
passed
Synced
Has a .msync.yml file
passed
Latest Modulesync
Has been synchronized with the latest tagged version of modulesync_config
passed
Has Modulesync
Is present in voxpupuli/modulesync_config/managed_modules.yml
passed
Released
Is in modulesync_config and in forge releases.
passed
Valid Sync File
If a (optional) sync file is present, it must not contain a `.travis.yml` entry.
passed
Reference Dot Md
The repository has a REFERENCE.md. It needs to be generated / puppet-strings documentation is missing.
passed

Open Pull Requests

Allow a specific value for the pip version, instead of upgrading virtualenv to latest
enhancement
needs-rebase
needs-work
tests-fail

Pull Request (PR) description

<!--
Change how pip version is set for virtual environments to support a user set value (ie pip==9.0.3)
-->

Open PR in GitHub
Fix facts for python rc version
bug
needs-rebase
needs-tests
tests-fail

Change regex in python_version and python_release facts so it matches python release candidate version (e.g. Python 2.7.16rc1, Python 3.7.3rc1).

Open PR in GitHub
Add python-venv installation
bug
tests-fail

Pull Request (PR) description

If you use python::pyvenv you require the package python-venv (name differs on OSes). This has been missing.

Open PR in GitHub
pyvenv: Verify that `latest` works
bug

This test currently fails because of https://github.com/voxpupuli/puppet-python/issues/586

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

<!--
Replace this comment with a description of your pull request.
-->

This Pull Request (PR) fixes the following issues

<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->

Open PR in GitHub
Fix pyvenv on some operating systems
bug
needs-tests

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

<!--
Replace this comment with a description of your pull request.
-->
For Ubuntu 18.04 and Debian 10, ensure distutils is installed.

When testing pyvenv I ran into this problem when using Python 3 and noticed if you install python3-venv instead of python3.7-venv it pulls in python3-distutils but rather than changing the behavior of how to install python*-venv just pulling in the dependency works.

Failure with/without system packages
```
root@debian10:/# python3.7 -m venv --clear --system-site-packages /opt/globus-cli
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

apt-get install python3-venv

You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/opt/globus-cli/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']

root@debian10:/# python3.7 -m venv --clear /opt/globus-cli
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

apt-get install python3-venv

You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/opt/globus-cli/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']
```

Solution:

```
root@debian10:/# apt-get install python3.7-distutils
Reading package lists... Done
Building dependency tree

Reading state information... Done
Note, selecting 'python3-distutils' instead of 'python3.7-distutils'
The following packages were automatically installed and are no longer required:
libexpat1-dev libpython-all-dev libpython-dev libpython2-dev libpython2.7 libpython2.7-dev python-all
python2-dev python2.7-dev
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
python3-distutils
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 142 kB of archives.
After this operation, 715 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 python3-distutils all 3.7.3-1 [142 kB]
Fetched 142 kB in 0s (333 kB/s)

debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package python3-distutils.
(Reading database ... 42675 files and directories currently installed.)
Preparing to unpack .../python3-distutils3.7.3-1all.deb ...
Unpacking python3-distutils (3.7.3-1) ...
Setting up python3-distutils (3.7.3-1) ...

root@debian10:/# python3.7 -m venv --clear --system-site-packages /opt/globus-cli
root@debian10:/#

```

Open PR in GitHub
pypa has updated its get-pip.py path

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

<!--
Pypa has updated its url of get-pip.py recently, so we need to update the url accordingly
-->

This Pull Request (PR) fixes the following issues

<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->

Open PR in GitHub
simplify packages version detection

Pull Request (PR) description

Simplify packages version detection

This Pull Request (PR) fixes the following issues

Fixes #617

Open PR in GitHub
If user declares their requirements.txt in Puppet, don't skip pip installation in python::requirements

@smortex

Pull Request (PR) description

Fixes issue wherein the python::requirements class does not correctly install a requirements.txt file declared in Puppet to the declared venv, e.g.


file { "${project_dir}/requirements.txt":
ensure => present,
content => file("${module_name}/requirements.txt")
}
-> python::pyvenv { "${project_dir}/pyenv":
ensure => present,
version => '3.6'
}
-> python::requirements {"${project_dir}/requirements.txt":
virtualenv => "${project_dir}/pyenv",
}

This appears to be due to the logic for setting the local resource subscription - it checks if the requirements file is not declared before setting the local subscription which ultimately gates the pip installation. This behavior runs contrary to the provided Example(s), in which requirements.txt must exist or be declared in advance of invoking the class:
https://forge.puppet.com/modules/puppet/python/reference#pythonrequirements

python::requirements { '/var/www/project1/requirements.txt' :
virtualenv => '/var/www/project1',
proxy => 'http://proxy.domain.com:3128',
owner => 'appuser',
group => 'apps',
}

Changes

  • Always set the local subscription in python::requirements, which is used to trigger the pip installation.

This Pull Request (PR) fixes the following issues

Fixes #613

Open PR in GitHub