Skip to content

Commit 73d5659

Browse files
committed
⬆️ Bump to sh 2
1 parent f526e6b commit 73d5659

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

pythonforandroid/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def strip_libraries(self, arch):
377377
libs_dir = join(self.dist_dir, f'_python_bundle__{arch.arch}',
378378
'_python_bundle', 'modules')
379379
filens = shprint(sh.find, libs_dir, join(self.dist_dir, 'libs'),
380-
'-iname', '*.so', _env=env).stdout.decode('utf-8')
380+
'-iname', '*.so', _env=env)
381381

382382
logger.info('Stripping libraries in private dir')
383383
for filen in filens.split('\n'):

pythonforandroid/build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
def get_targets(sdk_dir):
3030
if exists(join(sdk_dir, 'cmdline-tools', 'latest', 'bin', 'avdmanager')):
3131
avdmanager = sh.Command(join(sdk_dir, 'cmdline-tools', 'latest', 'bin', 'avdmanager'))
32-
targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
32+
targets = avdmanager('list', 'target').split('\n')
3333

3434
elif exists(join(sdk_dir, 'tools', 'bin', 'avdmanager')):
3535
avdmanager = sh.Command(join(sdk_dir, 'tools', 'bin', 'avdmanager'))
36-
targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
36+
targets = avdmanager('list', 'target').split('\n')
3737
elif exists(join(sdk_dir, 'tools', 'android')):
3838
android = sh.Command(join(sdk_dir, 'tools', 'android'))
39-
targets = android('list').stdout.decode('utf-8').split('\n')
39+
targets = android('list').split('\n')
4040
else:
4141
raise BuildInterruptingException(
4242
'Could not find `android` or `sdkmanager` binaries in Android SDK',

pythonforandroid/logger.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def shprint(command, *args, **kwargs):
166166
output = command(*args, **kwargs)
167167
for line in output:
168168
if isinstance(line, bytes):
169+
# TODO: adjust?
169170
line = line.decode('utf-8', errors='replace')
170171
if logger.level > logging.DEBUG:
171172
if full_debug:

pythonforandroid/recipe.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,7 @@ def unpack(self, arch):
469469
elif extraction_filename.endswith(
470470
('.tar.gz', '.tgz', '.tar.bz2', '.tbz2', '.tar.xz', '.txz')):
471471
sh.tar('xf', extraction_filename)
472-
root_directory = sh.tar('tf', extraction_filename).stdout.decode(
473-
'utf-8').split('\n')[0].split('/')[0]
472+
root_directory = sh.tar('tf', extraction_filename).split('\n')[0].split('/')[0]
474473
if root_directory != basename(directory_name):
475474
move(root_directory, directory_name)
476475
else:
@@ -1453,7 +1452,7 @@ def reduce_object_file_names(self, dirn):
14531452
coming from the local system.
14541453
"""
14551454
py_so_files = shprint(sh.find, dirn, '-iname', '*.so')
1456-
filens = py_so_files.stdout.decode('utf-8').split('\n')[:-1]
1455+
filens = py_so_files.split('\n')[:-1]
14571456
for filen in filens:
14581457
file_dirname, file_basename = split(filen)
14591458
parts = file_basename.split('.')

pythonforandroid/recipes/libxml2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def build_arch(self, arch):
2020
shprint(sh.Command('./autogen.sh'), _env=env)
2121
shprint(sh.Command('autoreconf'), '-vif', _env=env)
2222
build_arch = shprint(
23-
sh.gcc, '-dumpmachine').stdout.decode('utf-8').split('\n')[0]
23+
sh.gcc, '-dumpmachine').split('\n')[0]
2424
shprint(sh.Command('./configure'),
2525
'--build=' + build_arch,
2626
'--host=' + arch.command_prefix,

pythonforandroid/recipes/protobuf_cpp/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def build_arch(self, arch):
7676
with current_directory(self.get_build_dir(arch.arch)):
7777
build_arch = (
7878
shprint(sh.gcc, '-dumpmachine')
79-
.stdout.decode('utf-8')
8079
.split('\n')[0]
8180
)
8281

pythonforandroid/recipes/python3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def build_arch(self, arch):
320320

321321
android_build = sh.Command(
322322
join(recipe_build_dir,
323-
'config.guess'))().stdout.strip().decode('utf-8')
323+
'config.guess'))()
324324

325325
with current_directory(build_dir):
326326
if not exists('config.status'):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# https://github.com/kivy/buildozer/issues/722
2222
install_reqs = [
2323
'appdirs', 'colorama>=0.3.3', 'jinja2',
24-
'sh>=1.10, <2.0; sys_platform!="win32"',
24+
'sh>=2, <3.0; sys_platform!="win32"',
2525
'build', 'toml', 'packaging', 'setuptools', 'wheel~=0.43.0'
2626
]
2727
# (build and toml are used by pythonpackage.py)

0 commit comments

Comments
 (0)