Skip to content

Commit

Permalink
Merge pull request #3049 from kivy/feature/bump_sh_dep
Browse files Browse the repository at this point in the history
⬆️ Bump sh module to v2, refs #2746
  • Loading branch information
AndreMiras authored Aug 16, 2024
2 parents e982301 + f8e5c05 commit d7f0a1d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pythonforandroid/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
def get_targets(sdk_dir):
if exists(join(sdk_dir, 'cmdline-tools', 'latest', 'bin', 'avdmanager')):
avdmanager = sh.Command(join(sdk_dir, 'cmdline-tools', 'latest', 'bin', 'avdmanager'))
targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
targets = avdmanager('list', 'target').split('\n')

elif exists(join(sdk_dir, 'tools', 'bin', 'avdmanager')):
avdmanager = sh.Command(join(sdk_dir, 'tools', 'bin', 'avdmanager'))
targets = avdmanager('list', 'target').stdout.decode('utf-8').split('\n')
targets = avdmanager('list', 'target').split('\n')
elif exists(join(sdk_dir, 'tools', 'android')):
android = sh.Command(join(sdk_dir, 'tools', 'android'))
targets = android('list').stdout.decode('utf-8').split('\n')
targets = android('list').split('\n')
else:
raise BuildInterruptingException(
'Could not find `android` or `sdkmanager` binaries in Android SDK',
Expand Down
3 changes: 1 addition & 2 deletions pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,7 @@ def unpack(self, arch):
elif extraction_filename.endswith(
('.tar.gz', '.tgz', '.tar.bz2', '.tbz2', '.tar.xz', '.txz')):
sh.tar('xf', extraction_filename)
root_directory = sh.tar('tf', extraction_filename).stdout.decode(
'utf-8').split('\n')[0].split('/')[0]
root_directory = sh.tar('tf', extraction_filename).split('\n')[0].split('/')[0]
if root_directory != basename(directory_name):
move(root_directory, directory_name)
else:
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/python3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def build_arch(self, arch):

android_build = sh.Command(
join(recipe_build_dir,
'config.guess'))().stdout.strip().decode('utf-8')
'config.guess'))().strip()

with current_directory(build_dir):
if not exists('config.status'):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# https://github.com/kivy/buildozer/issues/722
install_reqs = [
'appdirs', 'colorama>=0.3.3', 'jinja2',
'sh>=1.10, <2.0; sys_platform!="win32"',
'sh>=2, <3.0; sys_platform!="win32"',
'build', 'toml', 'packaging', 'setuptools', 'wheel~=0.43.0'
]
# (build and toml are used by pythonpackage.py)
Expand Down

0 comments on commit d7f0a1d

Please sign in to comment.