Merge "Standardize import format"
This commit is contained in:
commit
566b8566c0
@ -173,3 +173,37 @@ or
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ pip install -e .
|
$ pip install -e .
|
||||||
|
|
||||||
|
Standardize Import Format
|
||||||
|
=========================
|
||||||
|
|
||||||
|
.. _`Import Order Guide`: http://docs.openstack.org/developer/hacking/#imports
|
||||||
|
|
||||||
|
The import order shows below:
|
||||||
|
|
||||||
|
* {{stdlib imports in human alphabetical order}}
|
||||||
|
* \n
|
||||||
|
* {{third-party lib imports in human alphabetical order}}
|
||||||
|
* \n
|
||||||
|
* {{project imports in human alphabetical order}}
|
||||||
|
* \n
|
||||||
|
* \n
|
||||||
|
* {{begin your code}}
|
||||||
|
|
||||||
|
Example
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
import copy
|
||||||
|
import fixtures
|
||||||
|
import mock
|
||||||
|
import os
|
||||||
|
|
||||||
|
from osc_lib.api import auth
|
||||||
|
from osc_lib import utils
|
||||||
|
import six
|
||||||
|
|
||||||
|
from openstackclient import shell
|
||||||
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
|
@ -17,11 +17,10 @@ import io
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from osc_lib import utils
|
||||||
import six
|
import six
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
|
|
||||||
from osc_lib import utils
|
|
||||||
|
|
||||||
from openstackclient.api import api
|
from openstackclient.api import api
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
|
|
||||||
"""Hypervisor Stats action implementations"""
|
"""Hypervisor Stats action implementations"""
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
class ShowHypervisorStats(command.ShowOne):
|
class ShowHypervisorStats(command.ShowOne):
|
||||||
|
@ -21,6 +21,7 @@ from osc_lib import utils
|
|||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_API_VERSION = '3'
|
DEFAULT_API_VERSION = '3'
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
"""Subnet pool action implementations"""
|
"""Subnet pool action implementations"""
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
"""Container v1 action implementations"""
|
"""Container v1 action implementations"""
|
||||||
|
|
||||||
|
|
||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
"""API Test Fakes"""
|
"""API Test Fakes"""
|
||||||
|
|
||||||
|
from keystoneauth1 import session
|
||||||
from requests_mock.contrib import fixture
|
from requests_mock.contrib import fixture
|
||||||
|
|
||||||
from keystoneauth1 import session
|
|
||||||
from openstackclient.tests import utils
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
"""Image v1 API Library Tests"""
|
"""Image v1 API Library Tests"""
|
||||||
|
|
||||||
|
from keystoneauth1 import session
|
||||||
from requests_mock.contrib import fixture
|
from requests_mock.contrib import fixture
|
||||||
|
|
||||||
from keystoneauth1 import session
|
|
||||||
from openstackclient.api import image_v1
|
from openstackclient.api import image_v1
|
||||||
from openstackclient.tests import utils
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
"""Image v2 API Library Tests"""
|
"""Image v2 API Library Tests"""
|
||||||
|
|
||||||
|
from keystoneauth1 import session
|
||||||
from requests_mock.contrib import fixture
|
from requests_mock.contrib import fixture
|
||||||
|
|
||||||
from keystoneauth1 import session
|
|
||||||
from openstackclient.api import image_v2
|
from openstackclient.api import image_v2
|
||||||
from openstackclient.tests import utils
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
|
from keystoneauth1 import session
|
||||||
from requests_mock.contrib import fixture
|
from requests_mock.contrib import fixture
|
||||||
|
|
||||||
from keystoneauth1 import session
|
|
||||||
from openstackclient.api import object_store_v1 as object_store
|
from openstackclient.api import object_store_v1 as object_store
|
||||||
from openstackclient.tests import utils
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from openstackclient.common import availability_zone
|
from openstackclient.common import availability_zone
|
||||||
|
@ -14,12 +14,11 @@
|
|||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.common import extension
|
from openstackclient.common import extension
|
||||||
from openstackclient.tests import fakes
|
|
||||||
from openstackclient.tests import utils
|
|
||||||
|
|
||||||
from openstackclient.tests.compute.v2 import fakes as compute_fakes
|
from openstackclient.tests.compute.v2 import fakes as compute_fakes
|
||||||
|
from openstackclient.tests import fakes
|
||||||
from openstackclient.tests.identity.v2_0 import fakes as identity_fakes
|
from openstackclient.tests.identity.v2_0 import fakes as identity_fakes
|
||||||
from openstackclient.tests.network.v2 import fakes as network_fakes
|
from openstackclient.tests.network.v2 import fakes as network_fakes
|
||||||
|
from openstackclient.tests import utils
|
||||||
from openstackclient.tests.volume.v2 import fakes as volume_fakes
|
from openstackclient.tests.volume.v2 import fakes as volume_fakes
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.common import quota
|
from openstackclient.common import quota
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
|
|
||||||
from openstackclient.compute.v2 import agent
|
from openstackclient.compute.v2 import agent
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import mock
|
import mock
|
||||||
import six
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from keystoneauth1 import fixture
|
from keystoneauth1 import fixture
|
||||||
import requests
|
import requests
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
AUTH_TOKEN = "foobar"
|
AUTH_TOKEN = "foobar"
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.identity.v3 import identity_provider
|
from openstackclient.identity.v3 import identity_provider
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.identity.v3 import user
|
from openstackclient.identity.v3 import user
|
||||||
|
@ -16,11 +16,10 @@
|
|||||||
import copy
|
import copy
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
import warlock
|
|
||||||
|
|
||||||
from glanceclient.v2 import schemas
|
from glanceclient.v2 import schemas
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils as common_utils
|
from osc_lib import utils as common_utils
|
||||||
|
import warlock
|
||||||
|
|
||||||
from openstackclient.image.v2 import image
|
from openstackclient.image.v2 import image
|
||||||
from openstackclient.tests import fakes
|
from openstackclient.tests import fakes
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from mock import call
|
from mock import call
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
|
|
||||||
from openstackclient.network.v2 import address_scope
|
from openstackclient.network.v2 import address_scope
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from keystoneauth1 import session
|
from keystoneauth1 import session
|
||||||
|
|
||||||
from openstackclient.api import object_store_v1 as object_store
|
from openstackclient.api import object_store_v1 as object_store
|
||||||
from openstackclient.tests import utils
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
|
import os
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from openstackclient.tests import fakes
|
from openstackclient.tests import fakes
|
||||||
|
@ -19,6 +19,7 @@ from osc_lib import utils
|
|||||||
|
|
||||||
from openstackclient.i18n import _
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_API_VERSION = '2'
|
DEFAULT_API_VERSION = '2'
|
||||||
|
Loading…
Reference in New Issue
Block a user