Skip to content

Testing locally fails due to wrong import order

Summary

Testing locally fails due to wrong import order

Steps to reproduce

OS: Ubuntu 18.04

At BuildStream Commit: aaf52d03

Using the following environment during testing:

platform linux -- Python 3.6.5, pytest-3.6.1, py-1.5.3, pluggy-0.6.0 -- /usr/bin/python3
plugins: forked-0.2, datafiles-1.0, env-0.6.2, pep8-1.0.6, pylint-0.9.0, cov-2.5.1, xdist-1.22.2

What is the current bug behavior?

When running tests locally (that is, not through the GitLab CI), the linting checks are failing on buildstream/_frontend/app.py due to incorrect import ordering.

What is the expected correct behavior?

The linting tests should pass.

Relevant logs and/or screenshots

=============================================================== FAILURES ================================================================
_________________________________________________ [pylint] buildstream/_frontend/app.py _________________________________________________
C: 29, 0: third party import "import click" should be placed before "from blessings import Terminal" (wrong-import-order)
C: 30, 0: third party import "from click import UsageError" should be placed before "from blessings import Terminal" (wrong-import-order)

Possible fixes

One solution is to change the order of the offending imports.

Other relevant information

We may also consider looking into the deeper issue of support for local testing and the divergence around this and testing performed on the GitLab CI, although I suspect this would be covered under a different issue.

  • BuildStream version affected: aaf52d03

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information