public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: venkata.pyla@toshiba-tsip.com
Cc: isar-users@googlegroups.com, amikan@ilbers.de,
	jan.kiszka@siemens.com, kazuhiro3.hayashi@toshiba.co.jp,
	dinesh.kumar@toshiba-tsip.com
Subject: Re: [PATCH] repro-build-test.py: Fix flake8 issues
Date: Sat, 7 Jan 2023 17:11:30 +0100	[thread overview]
Message-ID: <20230107171130.5eb3599b@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20230107115818.8267-1-venkata.pyla@toshiba-tsip.com>

Thanks!

Am Sat,  7 Jan 2023 17:28:18 +0530
schrieb venkata.pyla@toshiba-tsip.com:

> From: venkata pyla <venkata.pyla@toshiba-tsip.com>
> 
> It fixes following flake8 errors
> 
> F401 'glob' imported but unused
> F401 'os' imported but unused
> F401 're' imported but unused
> F401 'tempfile' imported but unused
> F401 'time' imported but unused
> F401 'cibuilder.isar_root' imported but unused
> E302 expected 2 blank lines, found 1
> E501 line too long (97 > 79 characters)
> E501 line too long (106 > 79 characters)
> E203 whitespace before ','
> E231 missing whitespace after ','
> E501 line too long (91 > 79 characters)
> E501 line too long (89 > 79 characters)
> E501 line too long (84 > 79 characters)
> E128 continuation line under-indented for visual indent
> E128 continuation line under-indented for visual indent
> E128 continuation line under-indented for visual indent
> E203 whitespace before ','
> E128 continuation line under-indented for visual indent
> E251 unexpected spaces around keyword / parameter equals
> E251 unexpected spaces around keyword / parameter equals
> 
> black: converts single quote strings to double quotes
> 
> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> ---
>  testsuite/repro-build-test.py | 64
> ++++++++++++++++++++--------------- 1 file changed, 36 insertions(+),
> 28 deletions(-)
> 
> diff --git a/testsuite/repro-build-test.py
> b/testsuite/repro-build-test.py index e89becf..5d92e2c 100755
> --- a/testsuite/repro-build-test.py
> +++ b/testsuite/repro-build-test.py
> @@ -1,14 +1,9 @@
>  #!/usr/bin/env python3
>  
> -import glob
> -import os
> -import re
> -import tempfile
> -import time
> -
> -from cibuilder import CIBuilder, isar_root
> +from cibuilder import CIBuilder
>  from avocado.utils import process
>  
> +
>  class ReproBuild(CIBuilder):
>  
>      """
> @@ -16,29 +11,38 @@ class ReproBuild(CIBuilder):
>  
>      :avocado: tags=repro-build
>      """
> +
>      def test_repro_build(self):
> -        target = self.params.get('build_target',
> default='mc:qemuamd64-bullseye:isar-image-base')
> -        source_date_epoch = self.params.get('source_date_epoch',
> default=self.git_last_commit_timestamp())
> +        target = self.params.get(
> +            "build_target",
> default="mc:qemuamd64-bullseye:isar-image-base"
> +        )
> +        source_date_epoch = self.params.get(
> +            "source_date_epoch",
> default=self.git_last_commit_timestamp()
> +        )
>          self.init()
> -        self.build_repro_image(target, source_date_epoch,
> 'image1.tar.gz')
> -        self.build_repro_image(target, source_date_epoch,
> 'image2.tar.gz')
> -        self.compare_repro_image('image1.tar.gz', 'image2.tar.gz')
> +        self.build_repro_image(target, source_date_epoch,
> "image1.tar.gz")
> +        self.build_repro_image(target, source_date_epoch,
> "image2.tar.gz")
> +        self.compare_repro_image("image1.tar.gz", "image2.tar.gz")
>  
>      def git_last_commit_timestamp(self):
> -        return process.run('git log -1 --pretty=%ct').stdout
> +        return process.run("git log -1
> --pretty=%ct").stdout.decode().strip() 
>      def get_image_path(self, target_name):
>          image_dir = "tmp/deploy/images"
> -        target_params = target_name.split(':')
> -        machine = target_params[1].split('-')[0]
> -        distro = 'debian-' + target_params[1].split('-')[1]
> +        target_params = target_name.split(":")
> +        machine = target_params[1].split("-")[0]
> +        distro = "debian-" + target_params[1].split("-")[1]

Was this ever tried against ubuntu?

Henning

>          image_type = target_params[2]
> -        return
> f'{image_dir}/{machine}/{image_type}-{distro}-{machine}.tar.gz'
> +        return
> f"{image_dir}/{machine}/{image_type}-{distro}-{machine}.tar.gz" 
> -    def build_repro_image(self, target, source_date_epoch=None
> ,image_name='image.tar.gz'):
> +    def build_repro_image(
> +        self, target, source_date_epoch=None,
> image_name="image.tar.gz"
> +    ):
>  
>          if not source_date_epoch:
> -            self.error("Reproducible build should configure with
> source_date_epoch time")
> +            self.error(
> +             "Reproducible build should configure with
> source_date_epoch time"
> +            )
>  
>          # clean artifacts before build
>          self.clean()
> @@ -54,15 +58,19 @@ class ReproBuild(CIBuilder):
>          self.move_in_build_dir(image_path, image_name)
>  
>      def clean(self):
> -        self.delete_from_build_dir('tmp')
> -        self.delete_from_build_dir('sstate-cache')
> +        self.delete_from_build_dir("tmp")
> +        self.delete_from_build_dir("sstate-cache")
>  
>      def compare_repro_image(self, image1, image2):
> -        self.log.info("Compare artifacts image1: " + image1 + ",
> image2: " + image2)
> -        result = process.run('diffoscope '
> -                        '--text ' + self.build_dir +
> '/diffoscope-output.txt'
> -                        ' ' + self.build_dir + '/' + image1 +
> -                        ' ' + self.build_dir + '/' + image2 ,
> -                        ignore_status = True)
> +        self.log.info(
> +            "Compare artifacts image1: " + image1 + ", image2: " +
> image2
> +        )
> +        result = process.run(
> +            "diffoscope "
> +            "--text " + self.build_dir + "/diffoscope-output.txt"
> +            " " + self.build_dir + "/" + image1 +
> +            " " + self.build_dir + "/" + image2,
> +            ignore_status=True,
> +        )
>          if result.exit_status > 0:
> -            self.fail(f'Images {image1} and {image2} are not
> reproducible')
> +            self.fail(f"Images {image1} and {image2} are not
> reproducible")


  reply	other threads:[~2023-01-07 16:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07 11:58 venkata.pyla
2023-01-07 16:11 ` Henning Schild [this message]
2023-01-09  7:21   ` Venkata.Pyla
2023-03-30  7:13 ` Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230107171130.5eb3599b@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=dinesh.kumar@toshiba-tsip.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kazuhiro3.hayashi@toshiba.co.jp \
    --cc=venkata.pyla@toshiba-tsip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox