[openstack-dev] [hacking] proposed rules drop for 1.0

Kevin L. Mitchell kevin.mitchell at rackspace.com
Tue Dec 9 20:23:18 UTC 2014

On Tue, 2014-12-09 at 13:46 -0500, Sean Dague wrote:
> Yes, the following fails H305 and H306.
> nova/tests/fixtures.py
> """Fixtures for Nova tests."""
> from __future__ import absolute_import
> import gettext
> import logging
> import os
> import uuid
> import fixtures
> from oslo.config import cfg
> from nova.db import migration
> from nova.db.sqlalchemy import api as session
> from nova import service
> Because name normalization is hard (fixtures is normalized to
> nova.tests.fixtures so H305 thinks it should be in group 3, and H306
> thinks it should be after oslo.config import cfg).
> To sort things you have to normalize them.

I agree you have to normalize imports to sort them, but to my mind the
appropriate normalization here is purely textual; we shouldn't be
expecting any relative imports (and should raise an error if there are
any).  Still, that does show that some work needs to be done to the
simpler H306 test (probably involving changes to the core import
Kevin L. Mitchell <kevin.mitchell at rackspace.com>

More information about the OpenStack-dev mailing list