Molecule: Document setuptools upgrade for CentOS7

Created on 21 Mar 2019  路  11Comments  路  Source: ansible-community/molecule

Installation described for CentOS 7 failed on a fresh GenericCloud image with:

$ sudo yum install -y epel-release
$ sudo yum install -y gcc python-pip python-devel openssl-devel libselinux-python
$ pip install --user molecule
[...]
Collecting testinfra==1.19.0 (from molecule==2.20)
  Using cached https://files.pythonhosted.org/packages/2b/96/3c0eb74894acf3e026e437ee1b1161a200adb9c9a189c36bc4a92ed2db79/testinfra-1.19.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-asndpD/testinfra/setup.py", line 59, in <module>
        'six>=1.4',
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 302, in finalize_options
        ep.load()(self, ep.name, value)
      File "/tmp/pip-build-asndpD/testinfra/setuptools_scm-3.2.0-py2.7.egg/setuptools_scm/integration.py", line 10, in version_keyword
      File "/tmp/pip-build-asndpD/testinfra/setuptools_scm-3.2.0-py2.7.egg/setuptools_scm/version.py", line 66, in _warn_if_setuptools_outdated
    setuptools_scm.version.SetuptoolsOutdatedWarning: your setuptools is too old (<12)

The version bump of testinfra from 1.16.0 to 1.19.0 by #1751 causes this issue.

docs

Most helpful comment

Hi @decentral1se,

a virtual environment is not an option because of the selinux trap:

Keep in mind that on selinux supporting systems, if you install into a virtual environment, you may face :gh:issue <ansible/ansible/issues/34340> even if selinux is not enabled or is configured to be permissive.

My solution is to upgrade setuptools via:

pip install --upgrade --user setuptools

Maybe this should be added to the documentation.

All 11 comments

Hi @robertvolkmann,

Ah yes, that makes sense. CentOS 7 ships with an old setuptools, no? I would recommend to install Molecule in a virtual environmen then. Or if you have some system wide friendly way to upgrade setuptools? We should document that this is a limitation on CentOS7.

Thoughts?

Also note, we're considering https://github.com/ansible/molecule/issues/1849 too.

Hi @decentral1se,

a virtual environment is not an option because of the selinux trap:

Keep in mind that on selinux supporting systems, if you install into a virtual environment, you may face :gh:issue <ansible/ansible/issues/34340> even if selinux is not enabled or is configured to be permissive.

My solution is to upgrade setuptools via:

pip install --upgrade --user setuptools

Maybe this should be added to the documentation.

@decentral1se I'd argue that we should go to testinfra upstream and ~tell them how to do their job~ make/ask/help them package proper wheels in which case setuptools wouldn't be involved at all.
I'm starting to think that we need to gather and organize a "Crusade" across our dependencies and tell them all to package things properly, probably providing help with that. It seems a bit better (easier?) than tutoring end-users about specifics of Python packaging...
I mean, I'm already doing this selectively sometimes. For example, I've got lxc lib on my list for implementing proper packaging for them... If someone is up to doing this, I'm willing to be consulting them should they need any help with doing modern packaging, because I myself don't have much time, unfortunately.

Good points @webknjaz and thanks for your work in and around the (mostly messy) world of Python packaging! I've raised https://github.com/philpep/testinfra/issues/417 and would like to see where it goes. If you have some time, it would be great to hear your opinions over there.

Instead of having to update documentation, why not preventing it from happening in the first place?

I suggest reopenign it, not sure why but I am unable to reopen it.

why not preventing it from happening in the first place?

That's why I raised https://github.com/philpep/testinfra/issues/417. The real fix is for testinfra. We've done all we reasonably can here with a documentation fix for now, that's why I closed it.

I am reopening because this bug affects us and we should keep it open as long molecule installation is affected by it, as we may rely to other workaround until the dependency is fixed.

Uhhhhh, can we close? https://github.com/philpep/testinfra/issues/417#issuecomment-476139740

runs away

I think so, but it's up to @ssbarnea since he reopened it in the first place.

I will close it because I was not able to reproduce it myself. Still, if we find a way to reproduce it we should reopen it.

Was this page helpful?
0 / 5 - 0 ratings