Update Makefile and fix some flake8 warnings

This commit is contained in:
Ivan A. Melnikov 2021-09-08 12:43:17 +04:00
parent 048ed5fe6c
commit b8a040caac
5 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@
all: flake8; @:
flake8:
python2-flake8 --ignore=F403,F405,W503 port_stats/
flake8 port_stats/
run:
python2 -im port_stats.interactive conf/local.json

View File

@ -105,7 +105,7 @@ def daily_report(out_dir, what, repos, all_tasks):
]
with open(stats_path, 'w') as stats:
for part in summary:
if isinstance(part, basestring):
if isinstance(part, (bytes, str)):
print(part, file=stats)
else:
print(*part, file=stats)

View File

@ -117,8 +117,8 @@ def _read_pkglist_pkglist_query(path):
query = subprocess.Popen(
["pkglist-query", _PKGLIST_QUERY_FORMAT, path],
stdout=subprocess.PIPE)
return (NEVR.from_tsv_line(l)
for l in query.communicate()[0].splitlines())
return (NEVR.from_tsv_line(line)
for line in query.communicate()[0].splitlines())
def read_pkglist(path):

View File

@ -261,10 +261,10 @@ def _from_64bit_dep(dep):
def have_same_source(repoA, repoB, source_name):
sourceA = repoA.sources.get(source_name)
sourceB = repoB.sources.get(source_name)
return (sourceA and sourceB and
sourceA.epoch == sourceB.epoch and
sourceA.version == sourceB.version and
sourceA.release == sourceB.release)
return (sourceA and sourceB
and sourceA.epoch == sourceB.epoch
and sourceA.version == sourceB.version
and sourceA.release == sourceB.release)
_BUILDREQ = '0000-BR'

View File

@ -87,7 +87,7 @@ def load_task(task_path, cached_task=None, now=None):
def load_tasks(prefixes, repo=None, cache=None):
if isinstance(prefixes, basestring):
if isinstance(prefixes, (bytes, str)):
prefixes = [prefixes]
LOG.info("Loading tasks from %s%s", ' '.join(prefixes),
" for " + repo if repo else "")