[libvirt] [PATCH sandbox-image 2/9] pylint: Move standard library imports on top

Radostin Stoyanov posted 9 patches 7 years ago
[libvirt] [PATCH sandbox-image 2/9] pylint: Move standard library imports on top
Posted by Radostin Stoyanov 7 years ago
Following PEP8 [1], imports should be grouped in the following order:

    standard library imports
    related third party imports
    local application/library specific imports

With a blank line between each group of imports.

[1] https://www.python.org/dev/peps/pep-0008/#imports

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
---
 scripts/virt-sandbox-image | 3 ++-
 setup.py                   | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/virt-sandbox-image b/scripts/virt-sandbox-image
index 9be4f8c..9d0ff82 100755
--- a/scripts/virt-sandbox-image
+++ b/scripts/virt-sandbox-image
@@ -1,8 +1,9 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
-from libvirt_sandbox_image import cli
 import sys
 
+from libvirt_sandbox_image import cli
+
 if __name__ == '__main__':
    sys.exit(cli.main())
diff --git a/setup.py b/setup.py
index f29be2f..85f5d45 100644
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,11 @@
 
-from setuptools import setup
-from distutils.command.build import build
-
 import os
 import re
 import time
 
+from distutils.command.build import build
+from setuptools import setup
+
 class my_build(build):
     user_options = build.user_options
 
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH sandbox-image 2/9] pylint: Move standard library imports on top
Posted by Cedric Bosdonnat 7 years ago
On Wed, 2018-04-18 at 21:57 +0100, Radostin Stoyanov wrote:
> Following PEP8 [1], imports should be grouped in the following order:
> 
>     standard library imports
>     related third party imports
>     local application/library specific imports
> 
> With a blank line between each group of imports.
> 
> [1] https://www.python.org/dev/peps/pep-0008/#imports
> 
> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
> ---
>  scripts/virt-sandbox-image | 3 ++-
>  setup.py                   | 6 +++---
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/virt-sandbox-image b/scripts/virt-sandbox-image
> index 9be4f8c..9d0ff82 100755
> --- a/scripts/virt-sandbox-image
> +++ b/scripts/virt-sandbox-image
> @@ -1,8 +1,9 @@
>  #!/usr/bin/env python3
>  # -*- coding: utf-8 -*-
>  
> -from libvirt_sandbox_image import cli
>  import sys
>  
> +from libvirt_sandbox_image import cli
> +
>  if __name__ == '__main__':
>     sys.exit(cli.main())
> diff --git a/setup.py b/setup.py
> index f29be2f..85f5d45 100644
> --- a/setup.py
> +++ b/setup.py
> @@ -1,11 +1,11 @@
>  
> -from setuptools import setup
> -from distutils.command.build import build
> -
>  import os
>  import re
>  import time
>  
> +from distutils.command.build import build
> +from setuptools import setup
> +
>  class my_build(build):
>      user_options = build.user_options
>  

ACK
--
Cedric

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list