Commit 7e5ec080 authored by Mattia Rizzolo's avatar Mattia Rizzolo

reproducible: fix all the imports, following pyflake3

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 3839455e
...@@ -11,7 +11,14 @@ ...@@ -11,7 +11,14 @@
# Track the database schema and changes to it. Also allow simple creation # Track the database schema and changes to it. Also allow simple creation
# and migration of it. # and migration of it.
from rblib import * import re
import sys
from datetime import datetime
from rblib import query_db
from rblib.confparse import log
from rblib.const import DB_METADATA
from rblib.utils import print_critiacal_message
now = datetime.now().strftime("%Y-%m-%d-%H-%M-%S") now = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
......
...@@ -10,12 +10,26 @@ ...@@ -10,12 +10,26 @@
# #
# Build a page full of CI issues to investigate # Build a page full of CI issues to investigate
import time
import os import os
import re
import csv
import time
import os.path import os.path
import datetime
from rblib import * from subprocess import check_call
from rblib.utils import create_temp_file, convert_into_hms_string, strip_epoch from timedate import timedelta
from rblib import query_db
from rblib.confparse import log
from rblib.models import Package
from rblib.html import tab, create_main_navigation, write_html_page
from rblib.utils import bcolors, create_temp_file, strip_epoch
from rblib.const import (
BIN_PATH,
DISTRO_BASE, DISTRO_URL,
HISTORY_PATH, RB_PKG_PATH, DBD_PATH, DBDTXT_PATH,
BUILDINFO_PATH, LOGS_PATH, DIFFS_PATH, RBUILD_PATH,
)
def unrep_with_dbd_issues(): def unrep_with_dbd_issues():
log.info('running unrep_with_dbd_issues check...') log.info('running unrep_with_dbd_issues check...')
......
...@@ -9,13 +9,19 @@ ...@@ -9,13 +9,19 @@
# #
# Get the output of dd-list(1) and turn it into some nice html # Get the output of dd-list(1) and turn it into some nice html
import os
import re
import lzma import lzma
import html as HTML
from urllib.request import urlopen from urllib.request import urlopen
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
from rblib import * from rblib import query_db
from rblib.bugs import Bugs from rblib.confparse import log
from rblib.const import DISTRO_BASE, DISTRO_URI, DISTRO_URL, SUITES
from rblib.models import Package
from rblib.html import create_main_navigation, write_html_page
arch = 'amd64' # the arch is only relevant for link targets here arch = 'amd64' # the arch is only relevant for link targets here
......
...@@ -10,10 +10,22 @@ ...@@ -10,10 +10,22 @@
# #
# Build quite all index_* pages # Build quite all index_* pages
import sys
from string import Template
from datetime import datetime, timedelta
from sqlalchemy import select, and_, or_, func, bindparam, desc from sqlalchemy import select, and_, or_, func, bindparam, desc
from rblib import *
from rblib.bugs import Bugs from rblib import query_db, db_table, get_status_icon
from rblib.confparse import log
from rblib.models import Package
from rblib.utils import print_critical_message from rblib.utils import print_critical_message
from rblib.html import tab, create_main_navigation, write_html_page
from rblib.const import (
DISTRO_BASE, DISTRO_URI, DISTRO_URL,
SUITES, ARCHS,
defaultsuite, defaultarch,
filtered_issues, filter_html,
)
""" """
Reference doc for the folowing lists: Reference doc for the folowing lists:
......
...@@ -7,14 +7,21 @@ ...@@ -7,14 +7,21 @@
# Licensed under GPL-2 # Licensed under GPL-2
# #
# Depends: python3 # Depends: python3
#
from rblib import * from string import Template
from reproducible_html_indexes import build_leading_text_section
from sqlalchemy import select, func, cast, Integer, and_, bindparam from sqlalchemy import select, func, cast, Integer, and_, bindparam
import glob
from rblib import query_db, db_table, get_status_icon
from rblib.confparse import log
from rblib.models import Package
from rblib.utils import convert_into_hms_string from rblib.utils import convert_into_hms_string
from rblib.html import tab, create_main_navigation, write_html_page
from reproducible_html_indexes import build_leading_text_section
from rblib.const import (
DISTRO_BASE, DISTRO_URL, DISTRO_URI,
ARCHS, SUITES,
defaultsuite,
)
# sqlalchemy table definitions needed for queries # sqlalchemy table definitions needed for queries
results = db_table('results') results = db_table('results')
......
...@@ -10,19 +10,36 @@ ...@@ -10,19 +10,36 @@
# #
# Build HTML pages based on the content of the notes.git repository # Build HTML pages based on the content of the notes.git repository
import os
import re
import sys
import copy import copy
import yaml import yaml
import popcon import popcon
import pystache import pystache
from string import Template
from collections import OrderedDict from collections import OrderedDict
from math import sqrt from math import sqrt
from rblib import *
from rblib.models import Package from rblib.models import Package
from rblib.bugs import Bugs from rblib.bugs import Bugs
from reproducible_html_packages import gen_packages_html from reproducible_html_packages import gen_packages_html
from reproducible_html_indexes import build_page from reproducible_html_indexes import build_page
from sqlalchemy import select, and_, bindparam from sqlalchemy import select, and_, bindparam
from rblib import query_db, get_status_icon, db_table, get_trailing_bug_icon
from rblib.confparse import log
from rblib.html import tab, create_main_navigation, write_html_page
from rblib.const import (
REPRODUCIBLE_URL,
TEMPLATE_PATH,
DISTRO_BASE, DISTRO_URL,
SUITES, ARCHS,
defaultsuite,
ISSUES_PATH, ISSUES_URI,
NOTES_PATH, NOTES_URI,
)
renderer = pystache.Renderer() renderer = pystache.Renderer()
notes_body_template = renderer.load_template( notes_body_template = renderer.load_template(
os.path.join(TEMPLATE_PATH, 'notes_body')) os.path.join(TEMPLATE_PATH, 'notes_body'))
......
...@@ -10,12 +10,31 @@ ...@@ -10,12 +10,31 @@
# #
# Build rb-pkg pages (the pages that describe the package status) # Build rb-pkg pages (the pages that describe the package status)
import os
import errno
import pystache import pystache
import apt_pkg import apt_pkg
apt_pkg.init_system() apt_pkg.init_system()
from rblib import * from rblib import query_db, get_status_icon
from rblib.confparse import log, args
from rblib.models import Package
from rblib.utils import strip_epoch, convert_into_hms_string from rblib.utils import strip_epoch, convert_into_hms_string
from rblib.html import gen_status_link_icon, write_html_page
from rblib.const import (
TEMPLATE_PATH,
REPRODUCIBLE_URL,
DISTRO_URL,
SUITES, ARCHS,
RB_PKG_PATH, RB_PKG_URI,
HISTORY_PATH, HISTORY_URI,
NOTES_PATH, NOTES_URI,
DBDTXT_PATH, DBDTXT_URI,
DBD_PATH, DBD_URI,
DIFFS_PATH, DIFFS_URI,
LOGS_PATH, LOGS_URI,
)
# Templates used for creating package pages # Templates used for creating package pages
renderer = pystache.Renderer(); renderer = pystache.Renderer();
...@@ -152,7 +171,7 @@ def gen_suitearch_details(package, version, suite, arch, status, spokenstatus, ...@@ -152,7 +171,7 @@ def gen_suitearch_details(package, version, suite, arch, status, spokenstatus,
buildinfo = pkg.builds[suite][arch].buildinfo buildinfo = pkg.builds[suite][arch].buildinfo
if buildinfo: if buildinfo:
context['buildinfo_uri'] = buildinfo.url context['buildinfo_uri'] = buildinfo.url
default_view = default_view if default_view else url default_view = default_view if default_view else buildinfo.url
elif not args.ignore_missing_files and status not in \ elif not args.ignore_missing_files and status not in \
('untested', 'blacklisted', 'FTBFS', 'not_for_us', 'depwait', '404'): ('untested', 'blacklisted', 'FTBFS', 'not_for_us', 'depwait', '404'):
log.critical('buildinfo not detected at ' + buildinfo.path) log.critical('buildinfo not detected at ' + buildinfo.path)
...@@ -162,7 +181,7 @@ def gen_suitearch_details(package, version, suite, arch, status, spokenstatus, ...@@ -162,7 +181,7 @@ def gen_suitearch_details(package, version, suite, arch, status, spokenstatus,
if rbuild: if rbuild:
context['rbuild_uri'] = rbuild.url context['rbuild_uri'] = rbuild.url
context['rbuild_size'] = sizeof_fmt(rbuild.size) context['rbuild_size'] = sizeof_fmt(rbuild.size)
default_view = default_view if default_view else url default_view = default_view if default_view else rbuild.url
context['buildlogs'] = get_buildlog_links_context(package, eversion, context['buildlogs'] = get_buildlog_links_context(package, eversion,
suite, arch) suite, arch)
elif status not in ('untested', 'blacklisted') and \ elif status not in ('untested', 'blacklisted') and \
...@@ -180,7 +199,6 @@ def gen_suitearch_details(package, version, suite, arch, status, spokenstatus, ...@@ -180,7 +199,6 @@ def gen_suitearch_details(package, version, suite, arch, status, spokenstatus,
def determine_reproducibility(status1, version1, status2, version2): def determine_reproducibility(status1, version1, status2, version2):
newstatus = ''
versionscompared = apt_pkg.version_compare(version1, version2); versionscompared = apt_pkg.version_compare(version1, version2);
# if version1 > version2, # if version1 > version2,
......
...@@ -12,15 +12,27 @@ ...@@ -12,15 +12,27 @@
# #
# Build rb-pkg pages (the pages that describe the package status) # Build rb-pkg pages (the pages that describe the package status)
from rblib import * import os
from rblib.bugs import Bugs
from rblib.utils import create_temp_file
import csv import csv
import time
import pystache import pystache
from datetime import datetime, timedelta
from subprocess import check_call
from collections import OrderedDict from collections import OrderedDict
from rblib import query_db, get_status_icon
from rblib.bugs import Bugs
from rblib.confpase import log
from rblib.models import Package
from rblib.utils import create_temp_file
from rblib.html import create_main_navigation, write_html_page, gen_status_link_icon
from rblib.const import (
BIN_PATH,
SUITES, ARCHS,
DISTRO_BASE, DISTRO_URI,
META_PKGSET, PKGSET_DEF_PATH,
TEMPLATE_PATH,
)
# Templates used for creating package pages # Templates used for creating package pages
renderer = pystache.Renderer() renderer = pystache.Renderer()
pkgset_navigation_template = renderer.load_template( pkgset_navigation_template = renderer.load_template(
......
...@@ -10,15 +10,20 @@ ...@@ -10,15 +10,20 @@
# #
# Build the reproducible.json and reproducibe-tracker.json files, to provide nice datasources # Build the reproducible.json and reproducibe-tracker.json files, to provide nice datasources
from rblib import *
from apt_pkg import version_compare
import aptsources.sourceslist
import json
import os import os
import subprocess import json
import tempfile import tempfile
import subprocess
from apt_pkg import version_compare
from rblib import query_db
from rblib.confparse import log
from rblib.const import (
DISTRO_URL,
REPRODUCIBLE_JSON, REPRODUCIBLE_TRACKER_JSON,
filter_query,
)
output = [] output = []
output4tracker = [] output4tracker = []
......
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
import os import os
import apt
import yaml import yaml
import json import json
from sqlalchemy import sql from sqlalchemy import sql
from apt_pkg import version_compare from apt_pkg import version_compare
from rblib import * from rblib import db_table, query_db
from rblib.confparse import log
from rblib.const import conn_db
from rblib.utils import print_critical_message, irc_msg from rblib.utils import print_critical_message, irc_msg
......
...@@ -16,10 +16,11 @@ import time ...@@ -16,10 +16,11 @@ import time
import subprocess import subprocess
from sqlalchemy import sql from sqlalchemy import sql
from detetime import datetime, timedelta from detetime import datetime, timedelta
from rblib.consts import SUITES, ARCHS
from rblib import query_db, db_table
from rblib.consts import SUITES, ARCHS, conn_db
from rblib.confparse import unknown_args, log from rblib.confparse import unknown_args, log
from rblib.utils import irc_msg from rblib.utils import bcolors, irc_msg
from rblib import bcolors, query_db, db_table, conn_db
def packages_matching_criteria(arch, suite, criteria): def packages_matching_criteria(arch, suite, criteria):
......
...@@ -10,6 +10,10 @@ import subprocess ...@@ -10,6 +10,10 @@ import subprocess
import sys import sys
import os import os
import argparse import argparse
from subprocess import check_call
from rblib.confparse import log
from rblib.const import PGDATABASE
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Create new Postgres database (reproducibledb) from backup.', description='Create new Postgres database (reproducibledb) from backup.',
...@@ -29,7 +33,6 @@ if not os.access(BACKUP_FILE, os.R_OK): ...@@ -29,7 +33,6 @@ if not os.access(BACKUP_FILE, os.R_OK):
# may not exist yet, but we would like to use the constants # may not exist yet, but we would like to use the constants
# available in reproducible_common.py # available in reproducible_common.py
sys.argv.append('--skip-database-connection') sys.argv.append('--skip-database-connection')
from rblib import *
from rblib.utils import print_critical_message from rblib.utils import print_critical_message
# Get database defined in reproducible_common.py # Get database defined in reproducible_common.py
......
...@@ -13,16 +13,18 @@ ...@@ -13,16 +13,18 @@
import sys import sys
import lzma import lzma
import deb822 import deb822
import aptsources.sourceslist
import smtplib import smtplib
from subprocess import call
from apt_pkg import version_compare
from urllib.request import urlopen
from sqlalchemy import sql from sqlalchemy import sql
from urllib.request import urlopen
from apt_pkg import version_compare
from email.mime.text import MIMEText from email.mime.text import MIMEText
from datetime import datetime, timedelta
from rblib import * from rblib import query_db, db_table
from rblib.confparse import log
from rblib.const import SUITES, ARCHS, conn_db
from rblib.utils import print_critical_message from rblib.utils import print_critical_message
from brlib.models import Package
from reproducible_html_live_status import generate_schedule from reproducible_html_live_status import generate_schedule
from reproducible_html_packages import gen_packages_html from reproducible_html_packages import gen_packages_html
from reproducible_html_packages import purge_old_pages from reproducible_html_packages import purge_old_pages
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# Configure which packages should trigger an email to the maintainer when the # Configure which packages should trigger an email to the maintainer when the
# reproducibly status change # reproducibly status change
import sys
import argparse import argparse
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
...@@ -25,7 +26,10 @@ parser.add_argument('-m', '--maintainer', default='', ...@@ -25,7 +26,10 @@ parser.add_argument('-m', '--maintainer', default='',
local_args = parser.parse_known_args()[0] local_args = parser.parse_known_args()[0]
# these are here as an hack to be able to parse the command line # these are here as an hack to be able to parse the command line
from rblib import * from rblib import query_db, db_table
from rblib.confparse import log, DEBUG
from rblib.const import conn_db
from rblib.models import Package
from rblib.utils import bcolors from rblib.utils import bcolors
from rblib.bugs import Udd from rblib.bugs import Udd
from reproducible_html_packages import gen_packages_html from reproducible_html_packages import gen_packages_html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment