nova-powervm tox pep8 fails for py3

Bug #1708163 reported by Matthew Edmonds
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-powervm
Fix Released
Undecided
Matthew Edmonds

Bug Description

I'm seeing the following error when I run `tox -re epep8` for nova-powervm (master) on a new Ubuntu 16.04.2 system:

Traceback (most recent call last):
  File ".tox/pep8/bin/flake8", line 11, in <module>
    sys.exit(main())
  File "/home/edmondsw/openstack/nova-powervm/.tox/pep8/lib/python3.5/site-packages/flake8/main.py", line 28, in main
    flake8_style = get_style_guide(parse_argv=True)
  File "/home/edmondsw/openstack/nova-powervm/.tox/pep8/lib/python3.5/site-packages/flake8/engine.py", line 234, in get_style_guide
    styleguide = StyleGuide(**kwargs)
  File "/home/edmondsw/openstack/nova-powervm/.tox/pep8/lib/python3.5/site-packages/flake8/engine.py", line 154, in __init__
    self._styleguide = kwargs.pop('styleguide', NoQAStyleGuide(**kwargs))
  File "/home/edmondsw/openstack/nova-powervm/.tox/pep8/lib/python3.5/site-packages/pep8.py", line 1651, in __init__
    options.logical_checks = self.get_checks('logical_line')
  File "/home/edmondsw/openstack/nova-powervm/.tox/pep8/lib/python3.5/site-packages/pep8.py", line 1747, in get_checks
    return sorted(checks)
TypeError: unorderable types: function() < function()

This appears to be specific to py3. If I change the tox.ini to make pep8 use py2.7, this error goes away.

Interestingly, nova is already forcing py2.7 for pep8 because py3 wasn't working for them [1]. The trace for the nova bug [2] looks different, but still...

[1] https://github.com/openstack/nova/commit/05583d14966a366f0d37753b81c8f72c87126348
[2] https://bugs.launchpad.net/designate/+bug/1456955

Revision history for this message
Matthew Edmonds (edmondsw) wrote :

I should mention that realpath `which python` returns /usr/bin/python2.7, so I have no idea why tox was using python3.5

Changed in nova-powervm:
assignee: nobody → Matthew Edmonds (edmondsw)
Revision history for this message
Matthew Edmonds (edmondsw) wrote :

flake8 version 2.5.5, pep8 version 1.7.0.

I also tried downgrading pep8 to 1.5.7 and the error persisted as long as tox was using py3.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova-powervm (master)

Fix proposed to branch: master
Review: https://review.openstack.org/490014

Changed in nova-powervm:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova-powervm (master)

Reviewed: https://review.openstack.org/490014
Committed: https://git.openstack.org/cgit/openstack/nova-powervm/commit/?id=b4eed72d1cd91fe0a246641f0ffb7701a85241b6
Submitter: Jenkins
Branch: master

commit b4eed72d1cd91fe0a246641f0ffb7701a85241b6
Author: Matthew Edmonds <email address hidden>
Date: Wed Aug 2 08:54:49 2017 -0400

    force python2.7 for tox pep8

    tox -re pep8 isn't working for systems that use python 3. Force tox
    to use python2.7 for pep8.

    Change-Id: I61468c3e3ab673dc84248dc72d1085c83ee57bc0
    Closes-Bug: #1708163

Changed in nova-powervm:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.