Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main()
@ 2017-07-20  5:26 Alexey Roslyakov
  2017-07-20  5:26 ` [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files Alexey Roslyakov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexey Roslyakov @ 2017-07-20  5:26 UTC (permalink / raw)
  To: buildroot

'if __name__ == "__main__"' idiom typically calls main function that
doesn't take any arguments in most cases. We shouldn't pass any tuple to
it.
I've tested the script with python-idna-2.5 and now it works with this
little change.

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
---
 utils/scanpypi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/scanpypi b/utils/scanpypi
index bb3899241b..9abf3c4139 100755
--- a/utils/scanpypi
+++ b/utils/scanpypi
@@ -255,12 +255,12 @@ class BuildrootPackage():
             # called through the if __name__ == '__main__' directive.
             # In this case, we can only pray that it is called through a
             # function called main() in setup.py.
-            setup.main([]) # Will raise AttributeError if not found
+            setup.main() # Will raise AttributeError if not found
             self.setup_metadata = self.setup_args[self.metadata_name]
         # Here we must remove the module the hard way.
         # We must do this because of a very specific case: if a package calls
         # setup from the __main__ but does not come with a 'main()' function,
-        # for some reason setup.main([]) will successfully call the main
+        # for some reason setup.main() will successfully call the main
         # function of a previous package...
         sys.modules.pop('setup',None)
         del setup
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files
  2017-07-20  5:26 [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Alexey Roslyakov
@ 2017-07-20  5:26 ` Alexey Roslyakov
  2017-07-20  5:51   ` Yegor Yefremov
  2017-07-20  5:49 ` [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Yegor Yefremov
  2017-07-20 20:28 ` Thomas Petazzoni
  2 siblings, 1 reply; 5+ messages in thread
From: Alexey Roslyakov @ 2017-07-20  5:26 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
---
 utils/scanpypi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/scanpypi b/utils/scanpypi
index 9abf3c4139..02384f2569 100755
--- a/utils/scanpypi
+++ b/utils/scanpypi
@@ -416,8 +416,8 @@ class BuildrootPackage():
             license=', '.join(licenses))
         lines.append(license_line)
 
-        filenames = ['LICENCE', 'LICENSE', 'LICENSE.TXT', 'COPYING',
-		     'COPYING.TXT']
+        filenames = ['LICENCE', 'LICENSE', 'LICENSE.RST', 'LICENSE.TXT',
+		     'COPYING', 'COPYING.TXT']
         license_files = list(find_file_upper_case(filenames, self.tmp_extract))
         license_files = [license.replace(self.tmp_extract, '')[1:]
                          for license in license_files]
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main()
  2017-07-20  5:26 [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Alexey Roslyakov
  2017-07-20  5:26 ` [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files Alexey Roslyakov
@ 2017-07-20  5:49 ` Yegor Yefremov
  2017-07-20 20:28 ` Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Yegor Yefremov @ 2017-07-20  5:49 UTC (permalink / raw)
  To: buildroot

Hi Alexey,

On Thu, Jul 20, 2017 at 7:26 AM, Alexey Roslyakov
<alexey.roslyakov@gmail.com> wrote:
> 'if __name__ == "__main__"' idiom typically calls main function that
> doesn't take any arguments in most cases. We shouldn't pass any tuple to
> it.
> I've tested the script with python-idna-2.5 and now it works with this
> little change.
>
> Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>

Good catch! I've tested it with cbor and it is now working like a charm.

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  utils/scanpypi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/utils/scanpypi b/utils/scanpypi
> index bb3899241b..9abf3c4139 100755
> --- a/utils/scanpypi
> +++ b/utils/scanpypi
> @@ -255,12 +255,12 @@ class BuildrootPackage():
>              # called through the if __name__ == '__main__' directive.
>              # In this case, we can only pray that it is called through a
>              # function called main() in setup.py.
> -            setup.main([]) # Will raise AttributeError if not found
> +            setup.main() # Will raise AttributeError if not found
>              self.setup_metadata = self.setup_args[self.metadata_name]
>          # Here we must remove the module the hard way.
>          # We must do this because of a very specific case: if a package calls
>          # setup from the __main__ but does not come with a 'main()' function,
> -        # for some reason setup.main([]) will successfully call the main
> +        # for some reason setup.main() will successfully call the main
>          # function of a previous package...
>          sys.modules.pop('setup',None)
>          del setup
> --
> 2.13.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files
  2017-07-20  5:26 ` [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files Alexey Roslyakov
@ 2017-07-20  5:51   ` Yegor Yefremov
  0 siblings, 0 replies; 5+ messages in thread
From: Yegor Yefremov @ 2017-07-20  5:51 UTC (permalink / raw)
  To: buildroot

On Thu, Jul 20, 2017 at 7:26 AM, Alexey Roslyakov
<alexey.roslyakov@gmail.com> wrote:
> Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  utils/scanpypi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/utils/scanpypi b/utils/scanpypi
> index 9abf3c4139..02384f2569 100755
> --- a/utils/scanpypi
> +++ b/utils/scanpypi
> @@ -416,8 +416,8 @@ class BuildrootPackage():
>              license=', '.join(licenses))
>          lines.append(license_line)
>
> -        filenames = ['LICENCE', 'LICENSE', 'LICENSE.TXT', 'COPYING',
> -                    'COPYING.TXT']
> +        filenames = ['LICENCE', 'LICENSE', 'LICENSE.RST', 'LICENSE.TXT',
> +                    'COPYING', 'COPYING.TXT']
>          license_files = list(find_file_upper_case(filenames, self.tmp_extract))
>          license_files = [license.replace(self.tmp_extract, '')[1:]
>                           for license in license_files]
> --
> 2.13.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main()
  2017-07-20  5:26 [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Alexey Roslyakov
  2017-07-20  5:26 ` [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files Alexey Roslyakov
  2017-07-20  5:49 ` [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Yegor Yefremov
@ 2017-07-20 20:28 ` Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2017-07-20 20:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 20 Jul 2017 12:26:37 +0700, Alexey Roslyakov wrote:
> 'if __name__ == "__main__"' idiom typically calls main function that
> doesn't take any arguments in most cases. We shouldn't pass any tuple to
> it.
> I've tested the script with python-idna-2.5 and now it works with this
> little change.
> 
> Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
> ---
>  utils/scanpypi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Both patches applied. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-20 20:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20  5:26 [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Alexey Roslyakov
2017-07-20  5:26 ` [Buildroot] [PATCH 2/2] scanpypi: include LICENSE.RST in the list of supported license files Alexey Roslyakov
2017-07-20  5:51   ` Yegor Yefremov
2017-07-20  5:49 ` [Buildroot] [PATCH 1/2] scanpypi: don't pass any arguments to main() Yegor Yefremov
2017-07-20 20:28 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox