Use a named logger

This commit is contained in:
Valentin Niess
2023-11-10 10:18:12 +01:00
parent e596fec38b
commit e249fdebdb
4 changed files with 29 additions and 24 deletions

View File

@@ -7,6 +7,7 @@ import sys
from ...appimage import build_appimage, relocate_python
from ...utils.docker import docker_run
from ...utils.fs import copy_tree
from ...utils.manylinux import format_appimage_name, format_tag
from ...utils.tmp import TemporaryDirectory
@@ -19,15 +20,6 @@ def _unpack_args(args):
return args.tag, args.abi, args.contained
def _manylinux_tag(tag):
'''Format Manylinux tag
'''
if tag.startswith('2_'):
return 'manylinux_' + tag
else:
return 'manylinux' + tag
def _get_appimage_name(abi, tag):
'''Format the Python AppImage name using the ABI and OS tags
'''
@@ -36,8 +28,7 @@ def _get_appimage_name(abi, tag):
fullversion = desktop[13:-8]
# Finish building the AppImage on the host. See below.
return 'python{:}-{:}-{:}.AppImage'.format(
fullversion, abi, _manylinux_tag(tag))
return format_appimage_name(abi, fullversion, tag)
def execute(tag, abi, contained=False):
@@ -46,7 +37,7 @@ def execute(tag, abi, contained=False):
if not contained:
# Forward the build to a Docker image
image = 'quay.io/pypa/' + _manylinux_tag(tag)
image = 'quay.io/pypa/' + format_tag(tag)
python = '/opt/python/' + abi + '/bin/python'
pwd = os.getcwd()
@@ -54,7 +45,11 @@ def execute(tag, abi, contained=False):
with TemporaryDirectory() as tmpdir:
copy_tree(dirname, 'python_appimage')
argv = ' '.join(sys.argv[1:])
argv = sys.argv[1:]
if argv:
argv = ' '.join(argv)
else:
argv = 'build manylinux {:} {:}'.format(tag, abi)
if tag.startswith("1_"):
# On manylinux1 tk is not installed
script = [

View File

@@ -35,7 +35,9 @@ def execute(tag):
script,
capture = True
)
for line in result.split(os.linesep):
if line:
log('LIST', "{1:7} -> /opt/python/{0:}".format(
*line.split()))
pythons = [line.split() for line in result.split(os.linesep) if line]
for (abi, version) in pythons:
log('LIST', "{:7} -> /opt/python/{:}".format(version, abi))
return pythons