Unit test jobs are failing with ImportError: cannot import name 'engine' from 'flake8'

Bug #1856600 reported by Nate Johnston
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
High
Brian Haley

Bug Description

Neutron unit test CI jobs are failing with the following error:

=========================
Failures during discovery
=========================
--- import errors ---
Failed to import test module: neutron.tests.unit.hacking.test_checks
Traceback (most recent call last):
  File "/usr/lib/python3.7/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.7/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/hacking/test_checks.py", line 15, in <module>
    from flake8 import engine
ImportError: cannot import name 'engine' from 'flake8' (/home/zuul/src/opendev.org/openstack/neutron/.tox/py37/lib/python3.7/site-packages/flake8/__init__.py)

Example: https://e859f0a6f5995c9142c5-a232ce3bdc50fca913ceba9a1c600c62.ssl.cf5.rackcdn.com/572767/23/check/openstack-tox-py37/1d036e0/job-output.txt

Looks like flake8 no longer has an engine but they had kept the api for backward compatibility [1], perhaps they broke it somehow.

[1] based on comment in https://gitlab.com/pycqa/flake8/blob/master/src/flake8/api/legacy.py#L3

Tags: gate-failure
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/699243

Changed in neutron:
assignee: nobody → Nate Johnston (nate-johnston)
status: New → In Progress
Revision history for this message
Nate Johnston (nate-johnston) wrote :

See related change https://review.opendev.org/#/c/699021/ which pins the version of hacking, which fixes this issue. But this will remain a problem if we ever unpin, so let's schedule a good time to figure out the dependency issues with unpinning.

Changed in neutron:
importance: Critical → High
Changed in neutron:
assignee: Nate Johnston (nate-johnston) → Brian Haley (brian-haley)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Brian Haley (<email address hidden>) on branch: master
Review: https://review.opendev.org/699243
Reason: Not required, file changed after move to hacking>3

Changed in neutron:
status: In Progress → Invalid
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.