From 0807e65b2a32689b0a756852191be931a2ff80e9 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Aug 18 2022 11:27:41 +0000 Subject: Repair flake8 complaints Signed-off-by: Ondrej Nosek --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 7084bdc..17388d7 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -370,7 +370,7 @@ class Commands(object): if not self._branch_merge: self.load_branch_merge() - return(self._branch_merge) + return self._branch_merge @branch_merge.setter def branch_merge(self, value): @@ -519,7 +519,7 @@ class Commands(object): if not self._localarch: self.load_localarch() - return(self._localarch) + return self._localarch def load_localarch(self): """Get the local arch as defined by rpm""" @@ -652,7 +652,7 @@ class Commands(object): """This property ensures the rel attribute""" if self._rel is None: self.load_nameverrel() - return(self._rel) + return self._rel @property def uses_autorelease(self): @@ -848,7 +848,7 @@ class Commands(object): if not self._repo: self.load_repo() - return(self._repo) + return self._repo def load_repo(self): """Create a repo object from our path""" @@ -865,7 +865,7 @@ class Commands(object): if not self._rpmdefines: self.load_rpmdefines() - return(self._rpmdefines) + return self._rpmdefines def load_rpmdefines(self): """Populate rpmdefines based on current active branch""" @@ -1143,7 +1143,7 @@ class Commands(object): """This property ensures the ver attribute""" if not self._ver: self.load_nameverrel() - return(self._ver) + return self._ver @property def mock_results_dir(self): @@ -1366,13 +1366,13 @@ class Commands(object): # between FC5 and FC12 or so. Nobody builds for that old # anyway. if int(re.search(r'\d+', self.distval).group()) < 6: - return('md5') + return 'md5' except Exception: # An error here is OK, don't bother the user. pass # Fall back to the default hash type - return(self.hashtype) + return self.hashtype def _fetch_remotes(self): self.log.debug('Fetching remotes') @@ -2876,7 +2876,7 @@ class Commands(object): ) # Return the mess - return(config) + return config def _config_dir_other(self, config_dir, filenames=('site-defaults.cfg', 'logging.ini')): diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index bffa561..2eaec52 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -198,7 +198,7 @@ class cliClient(object): if not self._cmd: self.load_cmd() - return(self._cmd) + return self._cmd def _get_bool_opt(self, opt, default=False): try: @@ -2463,7 +2463,7 @@ class cliClient(object): # if a scratch build modulemd was specified on the command line, # it's OK if the SCM info can't be determined if not modmd_path: - raise(e) + raise e auth_method, oidc_id_provider, oidc_client_id, oidc_client_secret, \ oidc_scopes = self.module_get_auth_config() diff --git a/pyrpkg/utils.py b/pyrpkg/utils.py index d3f7877..2d0e3ee 100644 --- a/pyrpkg/utils.py +++ b/pyrpkg/utils.py @@ -150,8 +150,8 @@ def make_koji_watch_tasks_handler(progname): if not quiet: tlist = ['%s: %s' % (t.str(), t.display_state(t.info)) for t in tasks.values() if not t.is_done()] - print("""Tasks still running. You can continue to watch with the '%s watch-task' command. -Running Tasks: %s""" % (progname, '\n'.join(tlist))) + print("Tasks still running. You can continue to watch with the '%s watch-task' command." + "\nRunning Tasks: %s" % (progname, '\n'.join(tlist))) # Save reference of the handler during first time use. # It guarantees that the same object is always returned (it allows unittest to pass). diff --git a/tests/test_cli.py b/tests/test_cli.py index c532f71..dc7d648 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -68,7 +68,7 @@ KOJI_UNIQUE_PATH_REGEX = r'^cli-build/\d+\.\d+\.[a-zA-Z]+$' def mock_get_rpm_package_name(self, rpm_file): - return(os.path.basename(rpm_file)[:-len('.src.rpm')]) + return os.path.basename(rpm_file)[:-len('.src.rpm')] class MockLayout(layout.DistGitLayout): @@ -2224,7 +2224,8 @@ class TestPatch(CliTestCase): @patch('os.rename') @patch('os.path.isdir', return_value=True) def test_rediff(self, isdir, rename): - origin_diff = '''diff -up fedpkg-1.29/fedpkg/__init__.py.origin fedpkg-1.29/fedpkg/__init__.py + origin_diff = \ + '''diff -up fedpkg-1.29/fedpkg/__init__.py.origin fedpkg-1.29/fedpkg/__init__.py --- fedpkg-1.29/fedpkg/__init__.py.origin 2017-10-05 01:55:34.268488598 +0000 +++ fedpkg-1.29/fedpkg/__init__.py 2017-10-05 01:55:59.736947877 +0000 @@ -9,12 +9,12 @@