voxpupuli / puppet-python

Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.
https://forge.puppetlabs.com/puppet/python
Apache License 2.0
199 stars 371 forks source link

Fixes for virtualenv_version fact when virtualenv > 20.x #537

Closed pjonesIDBS closed 4 years ago

pjonesIDBS commented 4 years ago

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

saz commented 4 years ago

Looks good to me.

Failing tests seems to be related to setuptools and deprecation of python 2

bastelfreak commented 4 years ago

@pjonesIDBS I rebased your PR and it should be green now. However, can you add a test for it?

pjonesIDBS commented 4 years ago

Hi Tim (@bastelfreak),

Just cloned my fork of the module and inspected it in VSC. It looks like there's already accetance tests in spec/acceptance/facts_test_spec.rb. There's also a unit test in spec/unit/facter/virtualenv_version_spec.rb.

I converted the module locally to use PDK (which worked like a charm).

The easiest solution to test was to update the unit test for virtualenv_version.

I set the factor "virtualenv_version_output" to be what we see with a version > 20.x (in this case 20.0.17) and then validated the facter would equal 20.0.17 with the rest of the string removed.

All looks good. The builds are still passing as they did previously.

saz commented 4 years ago

@pjonesIDBS I think it makes sense to check for both kinds of version, as this module might still be used with older virtualenv versions