Skip to content
Snippets Groups Projects
Commit 731dd474 authored by Simon McVittie's avatar Simon McVittie
Browse files

apt-install: Add mypy checking and fix pyflakes warnings

parent 743a3f0d
No related branches found
No related tags found
No related merge requests found
......@@ -40,11 +40,19 @@ import subprocess
import sys
import yaml
try:
import typing
except ImportError:
pass
else:
typing # silence "unused" warnings
logger = logging.getLogger('flatdeb.apt-install')
def main():
# type: (...) -> None
parser = argparse.ArgumentParser(
description='Install the given packages'
)
......@@ -73,8 +81,8 @@ def main():
if var in os.environ:
in_chroot.append('{}={}'.format(var, os.environ[var]))
options = []
packages = []
options = [] # type: typing.List[str]
packages = [] # type: typing.List[str]
if args.debug:
options.append('-oDebug::pkgDepCache::AutoInstall=true')
......@@ -98,6 +106,7 @@ def main():
'apt-get', 'clean',
])
if __name__ == '__main__':
if sys.stderr.isatty():
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment